exclude http headers from reponse?
Hi all,
I post data to a server and get response[in xml] back like this
Socket theSock =new Socket(serverhost,80);
PrintStream ps =new PrintStream(theSock.getOutputStream());
ps.println("POST /url HTTP/1.0");
.
.
SAXBuilder builder =new SAXBuilder();//==<< get reponse
Document doc = builder.build(theSock.getInputStream());
.
.
at builder.build I've got "SAXException: Parsing Error : The root element is required in a well-formed document" .
that because output from theSock.getInputStream() is
HTTP/1.1 200 OK
Date: Wed, 04 Jul 2007 10:14:54 GMT
Content-Length: 105
Content-Type: text/xml;charset=UTF-8
.
.
Connection: close
<resp>
<status>200</status>
<description>ok</description>
</resp>
I know that if i use HttpURLConnection the response InputStream will not contain http headers. But I'm just curious that with Socket, Is there any trick to get only content from InputStream?

