found an example

http://www.android-dev-faq.com/2011/11/how-to-make-httpdigest-client.html


Am 01.04.12 20:25, schrieb Ralph Bergmann | the4thFloor.eu:
> Hallo,
> 
> 
> why I can't add a "Authorization" header field to my get request?
> 
> AndroidHttpClient client = AndroidHttpClient.newInstance(useragent);
> 
> HttpParams httpParams = new BasicHttpParams();
> HttpConnectionParams.setConnectionTimeout(httpParams, 15 * 1000);
> HttpConnectionParams.setSoTimeout(httpParams, 15 * 1000);
> 
> HttpGet get = new HttpGet(url);
> get.addHeader("Authorization", "Base64 encoded String");
> get.addHeader("Accept", "application/json");
> get.setParams(httpParams);
> 
> ...
> 
> 
> When I execute this request I get a "HTTP/1.1 400 Bad Request" response.
> 
> When I remove the line "get.addHeader("Authorization", "Base64 encoded
> String");" everything works fine (without the authorization).
> 
> 
> What's going wrong? Is that the right way to do a basic authorization?
> How to add the header field?
> 
> 
> 
> Ralph
> 

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to