I am trying to use HTTPClient to post a lot of requests to a webservice which is protected using basic authentication. Although I am using the ThreadSafeClientConnManager, the Basic Authentication implementations of the Apache HTTPClient does not seem to be thread safe. Sometimes the requesting header doesn't contain the authorization element, wich causes a 401. Is there a common way or best practice to use Basic authentication with multiple threads?
I ran into the same issue recently. There's this logged issue: https://issues.apache.org/jira/browse/HTTPCLIENT-1168 You have two choices it seems:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With