OK,

I've discovered why I'm not seeing the body as the result of the PUT,
it's a feature of HttpClient.

Tomcat is sending me the following response
HTTP/1.1 200 OK
Content-Type: text/xml
Content-Length: 132
Content-Type: text/xml
Date: Thu, 21 Feb 2002 13:21:35 GMT
Content-Length: 132
Server: Apache Tomcat/4.0.2 (HTTP/1.1 Connector)
SOAPAction: ""

Followed by the data.

Notice that there are two (identical) content-type and content-length
headers. The value of the Content-Type
org.apache.commons.httpclient.Header is now "132, 132" and so doesn't
parse.

This is being done by the JAXM Ref Impl - it's calling
resp.addHeader("Content-Length", 132) twice. I've seen mention that
HttpClient handles some pathological cases - is this something it should
handle?

Kevin Jones
Developmentor
www.develop.com 

> -----Original Message-----
> From: Kevin Jones [mailto:[EMAIL PROTECTED]] 
> Sent: 21 February 2002 11:11
> To: Jakarta Commons Developers List
> Subject: [httpclient] Request For Enhancement
> 
> 
> I'd like to use http-commons as the client side of a web services
> application. To do this I need to use PostMethod to send 
> text/xml from a
> stream and then read the response.
> 
> I know I can override PutMethod to do the send but a) this 
> seems like a
> kludge b) seems un-necessary as this should be part of 
> PostMethod and c)
> PutMethod doesn't seem to return the body to me (I'm about to
> investigate the source to see if this is the case).
> 
> So I have an RFE. Would it be possible to add support to PostMethod to
> send data other than as a set of query strings/parameters. Ideally it
> would work like HttpURLConnection where I could stream the data,
> PostMethod would calculate the length, set the Content-Length 
> header and
> then send the data.
> 
> If this is already in the pipeline, great. If not (and nobody 
> is looking
> at this) could somebody point out any pitfalls I'd have 
> adding this code
> to PostMethod,
> 
> Kevin Jones
> Developmentor
> www.develop.com 
> 
> 
> --
> To unsubscribe, e-mail:   
> <mailto:commons-dev-> [EMAIL PROTECTED]>
> For 
> additional commands, 
> e-mail: <mailto:[EMAIL PROTECTED]>
> 


--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>


Reply via email to