Post messaging using HTTPClient

Discussion in 'Java' started by Renu, Aug 19, 2003.

  1. Renu

    Renu Guest

    Hi,
    I'm able to post message on a server using HTTPClient. Server receives
    the XML request and sends the XML response, I'm able to receive the
    response which is in the form of header, body What i want is to
    extract the body of the XML response so that i can parse the XML
    response using DOMParser. I tried almost all the API's of HTTPClient
    but am unable to extract the Body(eg: getResponseBody etc). If anyone
    knows how to go bout it do let me know asap.

    Thanx and Regards,
    Renu
    Renu, Aug 19, 2003
    #1
    1. Advertising

  2. Renu

    biro Guest


    > Hi,
    > I'm able to post message on a server using HTTPClient. Server receives
    > the XML request and sends the XML response, I'm able to receive the
    > response which is in the form of header, body What i want is to
    > extract the body of the XML response so that i can parse the XML
    > response using DOMParser. I tried almost all the API's of HTTPClient
    > but am unable to extract the Body(eg: getResponseBody etc). If anyone
    > knows how to go bout it do let me know asap.



    > > Thanx and Regards, Renu


    Do you mean the response is sent as a HTTP response but its formatted XML
    after the headers? You could get the entire response, and dump the headers
    by looking for the first blank line - that signifies the end of the headers.
    biro, Aug 19, 2003
    #2
    1. Advertising

  3. "Renu" <> wrote in message
    news:...
    > Hi,
    > I'm able to post message on a server using HTTPClient. Server receives
    > the XML request and sends the XML response, I'm able to receive the
    > response which is in the form of header, body What i want is to
    > extract the body of the XML response so that i can parse the XML
    > response using DOMParser. I tried almost all the API's of HTTPClient
    > but am unable to extract the Body(eg: getResponseBody etc). If anyone
    > knows how to go bout it do let me know asap.


    You should be able to use the getResponseBodyAsStream or
    getResponseBodyAsString methods - they are in the HttpMethod
    class, not the HttpClient class.

    WBB
    William Brogden, Aug 19, 2003
    #3
  4. Renu

    Renu Guest

    I have tried both the methods getResponseBodyAsStream and
    getResponseBodyAsString of HTTPMethod, it returns the header as well
    as the body. I want to extract the body part which i'm not able to do
    using the API's.

    "William Brogden" <> wrote in message news:<>...
    > "Renu" <> wrote in message
    > news:...
    > > Hi,
    > > I'm able to post message on a server using HTTPClient. Server receives
    > > the XML request and sends the XML response, I'm able to receive the
    > > response which is in the form of header, body What i want is to
    > > extract the body of the XML response so that i can parse the XML
    > > response using DOMParser. I tried almost all the API's of HTTPClient
    > > but am unable to extract the Body(eg: getResponseBody etc). If anyone
    > > knows how to go bout it do let me know asap.

    >
    > You should be able to use the getResponseBodyAsStream or
    > getResponseBodyAsString methods - they are in the HttpMethod
    > class, not the HttpClient class.
    >
    > WBB
    Renu, Aug 21, 2003
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Wil Hadden

    Jakarta HttpClient POST question

    Wil Hadden, Nov 8, 2004, in forum: Java
    Replies:
    11
    Views:
    3,688
    blueray
    Jul 1, 2009
  2. cocobear
    Replies:
    1
    Views:
    422
    cocobear
    Jun 14, 2007
  3. KEN
    Replies:
    1
    Views:
    781
    Bjoern Hoehrmann
    Jun 23, 2007
  4. Sebastian
    Replies:
    1
    Views:
    1,353
    Sebastian
    Jun 22, 2011
  5. KEN

    XML HTTP POST Messaging

    KEN, Jun 22, 2007, in forum: Javascript
    Replies:
    0
    Views:
    81
Loading...

Share This Page