1. Download our Official Android App: Forums for Android!

Error in Content-Lenth

Discussion in 'Android Apps & Games' started by roopalinasa, May 7, 2010.

  1. roopalinasa

    roopalinasa Lurker
    Thread Starter
    Rank:
    None
    Points:
    25
    Posts:
    6
    Joined:
    Mar 24, 2010

    Mar 24, 2010
    6
    0
    25
    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:
     

    Advertisement

Share This Page

Loading...