• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Error in Content-Lenth

roopalinasa

Lurker
Mar 24, 2010
6
0
Hi guys,

I am fetching portfolio details from google finance. For this i have make httppost as below:

HttpClient httpClient = new DefaultHttpClient();

HttpPost httpPost = new HttpPost("http://finance.google.com/finance/feeds/default/portfolios");

httpPost.addHeader("Authorization", "GoogleLogin auth="+authToken);

httpPost.addHeader("GData-Version", "2");

// httpPost.addHeader("content-length","314");

httpPost.addHeader("Content-Type","application/x-www-form-urlencoded");
// httpPost.addHeader("Connection","Keep-Alive");



HttpResponse httpResponse = httpClient.execute(httpPost);

but i am getting error: POST requests require a <code>Content-length</code> header.

If i am putting content-length, thn again it showing thata contene-Length already present.

Can anybody suggest me..????:thinking:
 

BEST TECH IN 2023

We've been tracking upcoming products and ranking the best tech since 2007. Thanks for trusting our opinion: we get rewarded through affiliate links that earn us a commission and we invite you to learn more about us.

Smartphones