1. Introducing Channels - a new way to chat with other Android users!
    Dismiss Notice

Error in Content-Lenth


Last Updated:

  1. roopalinasa

    roopalinasa Member This Topic's Starter

    Joined:
    Mar 24, 2010
    Messages:
    6
    Likes Received:
    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..????:confused:
     

    Advertisement

Share This Page

Loading...