How do I add basic authentication for the default client of the httpClient library? I have seen examples where they use client.getCredentialProvider(), however I think all of this methods are for library version 4.0.1 or 3.x. Is there a new example of how to do this? Thanks a lot.
How do I add basic authentication for the default client of the httpClient library?
Share
We do basic authentication with
HttpClient, but we do not useCredentialProvider. Here’s the code:UPDATE:
A stated in the comments, the
HttpClient.getState()methos is available in version 3.x of the API. However, newer versions of the API doesn’t support that method.