hc-httpclient-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ashish Kulkarni" <ashish.kulkarn...@gmail.com>
Subject Basic Authentication Issue
Date Tue, 20 May 2008 14:51:08 GMT
I have PDF file to download from a server which has basic authentication,
I have the following code, but it gives 401 error, but if i take the same
url in a browser and then enter user id, password in the popup box it works,
so what may be the issue

HttpClient client = new HttpClient();

new AuthScope("http://uskzoas163/MpssDocDisplay/", 80),
new UsernamePasswordCredentials(userId, password)

GetMethod method = new GetMethod("
method.setDoAuthentication( true );
new DefaultHttpMethodRetryHandler(3, false));

int statusCode = client.executeMethod(method);

status i get is 401, not authorised,

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message