I am try to get data from share point server. Following is my code.
DefaultHttpClient httpclient = new DefaultHttpClient();
httpclient.getAuthSchemes().register("ntlm", new NTLMSchemeFactory());
httpclient.getCredentialsProvider().setCredentials(new AuthScope("masconsult.eu", -1),
new NTCredentials(username, password, "", ""));
HttpGet httpGet = new HttpGet(webserviceUrl);
httpGet.addHeader("Content-type", "application/json");
httpGet.getParams().setBooleanParameter(CoreProtocolPNames.USE_EXPECT_CONTINUE, false);
// HttpResponse response="";
String responseXML = "";
HttpResponse response = httpclient.execute(httpGet);
response.getStatusLine().getReasonPhrase();
responseXML = EntityUtils.toString(response.getEntity());
Toast.makeText(this, responseXML, Toast.LENGTH_LONG).show();
I have got response HTTP/1.1 401 Unauthorized. Even I have added all right credential. In Chrome browser It working fine with same credential. plz suggest me any change in code.