×

Discussion Board

Results 1 to 6 of 6

Hybrid View

  1. #1
    Nokia Developer Expert
    Join Date
    Feb 2005
    Location
    India
    Posts
    209

    Http Post request response

    Hi,
    I am working on a 3'rd edition application which talks to a server through xml and get the response in xml data. Following pease of code from http engine example will give the idea. The problem i am facing now is in the usage of xml data. I am getting "Header recieved: Status 400 Bad Request".

    TBuf<10000> postData;
    TBuf<KDefaultBufferSize> uri = _L("http://test....com/");
    ParseXml();
    postData.Copy(buf2);
    TInt len;
    len = postData.Length();

    // Issue HTTP post to engine
    iClient->CancelTransaction();

    iAppView->ResetL();

    // Insert prefix to uri (it must begin with "http://" or "https://")
    TBuf8<KDefaultBufferSize> uri8;
    uri.LowerCase();
    if(uri.Find(KHttpPrefix) == KErrNotFound
    && uri.Find(KHttpsPrefix) == KErrNotFound)
    {
    // If uri does not contain http or https,
    // use the default, "http://"
    uri8.Append(KHttpPrefix8);
    uri8.Append(uri);
    }
    else
    {
    uri8.Copy(uri);
    }

    TBuf8<10000> postData8;
    postData8.Copy(postData);

    // Start transaction
    iClient->IssueHTTPPostL(uri8, KMimeType, postData8);


    ParseXml() parses an xml file an stores the data in postData , which is send as one of the parameters.

    If some one worked on xml data in http request please guide me..

    Anoop
    Anoop..

  2. #2
    Nokia Developer Moderator
    Join Date
    Mar 2003
    Location
    Lempäälä/Finland
    Posts
    29,165

    Re: Http Post request response

    here's one link to look into: http://www.checkupdown.com/status/E400.html

  3. #3
    Nokia Developer Expert
    Join Date
    Feb 2005
    Location
    India
    Posts
    209

    Re: Http Post request response

    HI yucca,
    Thanks for the quick response. Which area in the code segment or the networking area i need to focus more to clear this issue.
    Anoop..

  4. #4
    Nokia Developer Expert
    Join Date
    Feb 2005
    Location
    India
    Posts
    209

    Re: Http Post request response

    I was trying to send xml request along with the server url in the Httpexample post request. The reply i am getting is like 400 Bad Request. The xml request is copied to a TBuf and send in "IssueHTTPPostL" as you can see in the code segment above. Please advice on were i have gone wrong..
    Anoop..

  5. #5
    Nokia Developer Expert
    Join Date
    Feb 2005
    Location
    India
    Posts
    209

    Re: Http Post request response

    Anyone has any code segment or sample example workig on http post with xml data transfer.
    Anoop..

  6. #6
    Super Contributor
    Join Date
    Mar 2004
    Location
    Singapore
    Posts
    9,968

    Re: Http Post request response

    Quote Originally Posted by anoopd View Post
    Anyone has any code segment or sample example workig on http post with xml data transfer.
    is your server need the data in a specific format. or header ?

Similar Threads

  1. problem with Http response head
    By yang_xixiang in forum Symbian
    Replies: 1
    Last Post: 2009-11-02, 18:59
  2. KErrCorrupt in a HTTP Post request
    By deepka in forum Symbian Networking & Messaging (Closed)
    Replies: 3
    Last Post: 2008-06-24, 14:06
  3. Receive uncomplete HTTP response
    By apitoman in forum Symbian Networking & Messaging (Closed)
    Replies: 6
    Last Post: 2004-03-24, 16:15
  4. nokia 7210 modem via IR doesn't work !
    By oussamaaiadi in forum PC Suite API and PC Connectivity SDK
    Replies: 1
    Last Post: 2003-03-06, 10:46

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×