Hi
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();
client.getState().setCredentials(
new AuthScope("http://uskzoas163/MpssDocDisplay/", 80),
new UsernamePasswordCredentials(userId, password)
);
GetMethod method = new GetMethod("
http://uskzoas163/MpssDocDisplay/ALTERNATE/PMS-PAD/V_1/00-625080-000_PMS.pdf
");
method.setDoAuthentication( true );
method.getParams().setParameter(HttpMethodParams.RETRY_HANDLER,
new DefaultHttpMethodRetryHandler(3, false));
int statusCode = client.executeMethod(method);
status i get is 401, not authorised,
Ashish