You are viewing a plain text version of this content. The canonical link for it is here.
Posted to httpclient-users@hc.apache.org by Christian Chitão Teixeira <ct...@mercador.com> on 2007/09/24 19:21:34 UTC
HTTP/1.1 401 Unauthorized xxx
Hello everyone..
I'm new here, so that means I have a problem...
I'm tring to make a 'get' from a 'http' with autentication, it gets the rigth realm, but the user is not autenticated.. I'm tring to get as XML file...
When I do that without the user and pwd autentication, it works fine...
The code goes like this:
client = new HttpClient();
client.getState().setCredentials(new AuthScope(http://123.12.12. <http://123.12.12.12> 12, 80, null), new UsernamePasswordCredentials("MyUser", "MyPwd") );
getMethod = new GetMethod("http://123.12.12.12/test/MyXMLfileLocation");
getMethod.setDoAuthentication(true);
getMethod.getParams().setParameter("http.socket.timeout", new Integer(60000));
int statusCode = client.executeMethod( getMethod );
anyone?
Thank's for your time...
Christian