I don't see it in the docs, ok here:
Does HttpClientauthorization support HTTP (proactive or otherwise) with credentials in the URL string?
For example: http://foo:bar@hostname/Hello/World enter the username fooand password barfor authorization (in fact authentication, but only using the same nomenclature).
Basically:
HttpClient client = new HttpClient();
GetMethod get = new GetMethod("http://foo:bar@hostname/Hello/World");
against:.
HttpClient client = new HttpClient();
client.getState().setCredentials(
new AuthScope( );
, new UsernamePasswordCredentials("foo","bar");
);
GetMethod get = new GetMethod("http://foo:bar@hostname/Hello/World");
get.setDoAuthentication(true);
I did not feel joy.
Am I something wrong?
source
share