You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@hc.apache.org by Daniel Walsh <da...@verizon.net> on 2003/02/27 02:26:43 UTC

MultipartPostMethod creating malformed headers?

I'm getting a new exception thrown by the servlet I'm pointing to when I use today's (Feb. 26th) source for MultipartPostMethod.  It complains about a malformed header line.  When I point back to an older version of HttpClient, I don't get this exception.  Any ideas?

Daniel

Re: MultipartPostMethod creating malformed headers?

Posted by Ortwin Glück <or...@nose.ch>.
Can you post the response headers? You could use wire log to see them.

Daniel Walsh wrote:
> I'm getting a new exception thrown by the servlet I'm pointing to
> when I use today's (Feb. 26th) source for MultipartPostMethod.  It
> complains about a malformed header line.  When I point back to an
> older version of HttpClient, I don't get this exception.  Any ideas?
> 
> Daniel
> 


Re: MultipartPostMethod creating malformed headers?

Posted by Oleg Kalnichevski <o....@dplanet.ch>.
On Thu, 2003-02-27 at 21:29, Daniel Walsh wrote:
> >What library are you using to parse 'multipart/form-data'
> > formatted requests?
> 
> We actually have our own classes to parse a multipart/form-data formatted
> request.  I guess they could be a bit outdated at this point, or possible
> never were completely spec compliant themselves.  The specification has
> remained the same since August of 1998, right?

That's the reference I used when working on the multipart post 
http://www.faqs.org/rfcs/rfc2388.html

Looks like it has been last updated in August of 1998


> 
> >Can you post the response headers? You could use wire log to see them.
> 
> I'm not familiar with wire log.  These are the headers that I get by calling
> multipartpostmethod.getRequestHeaders() and
> multipartpostmethod.getResponseHeaders(), respectively.  Although, my
> understanding was that multipart/form-data formatted requests contained
> multiple sets of headers for each part in the message.  If that sounds
> correct, I've yet to find the way to extract each part's headers.  ...I'll
> try to come up to speed on wire log.
> 

Please refer to the HttpClient logging guide for instructions. 

http://jakarta.apache.org/commons/httpclient/logging.html

You might need to get the latest CVS snapshot, though, in order to be
able to obtain a complete wire log that would include request/response
body content  

> From what I have here, I don't see a content-transfer-encoding header...
> 

I did not mean HTTP request headers, rather those of multipart/form-data
content parts. 

    --AaB03x
    content-disposition: form-data; name="field1"
    content-type: text/plain;charset=windows-1250
    content-transfer-encoding: quoted-printable

    Joe owes =80100.
    --AaB03x

Cheers

Oleg


Re: MultipartPostMethod creating malformed headers?

Posted by Daniel Walsh <da...@verizon.net>.
>What library are you using to parse 'multipart/form-data'
> formatted requests?

We actually have our own classes to parse a multipart/form-data formatted
request.  I guess they could be a bit outdated at this point, or possible
never were completely spec compliant themselves.  The specification has
remained the same since August of 1998, right?

>Can you post the response headers? You could use wire log to see them.

I'm not familiar with wire log.  These are the headers that I get by calling
multipartpostmethod.getRequestHeaders() and
multipartpostmethod.getResponseHeaders(), respectively.  Although, my
understanding was that multipart/form-data formatted requests contained
multiple sets of headers for each part in the message.  If that sounds
correct, I've yet to find the way to extract each part's headers.  ...I'll
try to come up to speed on wire log.

Re: MultipartPostMethod creating malformed headers?

Posted by Oleg Kalnichevski <o....@dplanet.ch>.
Daniel,
The MultipartPost have been recently revised to be more spec compliant.
It appears it has become a bit 'too compliant' for your CGI script to
handle. What library are you using to parse 'multipart/form-data'
formatted requests? Each part now includes 'Content-Type' and
'Content-Transfer-Encoding' headers. It seems that the library does not
like them that much

Cheers

Oleg


On Thu, 2003-02-27 at 02:26, Daniel Walsh wrote:
> I'm getting a new exception thrown by the servlet I'm pointing to when I use today's (Feb. 26th) source for MultipartPostMethod.  It complains about a malformed header line.  When I point back to an older version of HttpClient, I don't get this exception.  Any ideas?
> 
> Daniel