You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by Martin Cooper <ma...@tumbleweed.com> on 2002/07/25 08:44:20 UTC

[HttpClient] Adding support for multipart/form-data

I've been looking at the HttpClient code recently, with a view to adding
support for the 'multipart/form-data' content type for the 'post' method.
Amongst other things, this would allow HttpClient to be used for file
uploads, in addition to regular requests using this (frequently used)
content type.

Unfortunately, unless I'm mistaken (I hope I am!), it seems that support for
this content type will require significant changes throughout the HttpClient
code base. The problem is that the current code assumes that the value for a
given request parameter is always a String. While this may be sufficient for
other methods and encoding types, it does not provide enough information for
the 'post' method when 'multipart/form-data' is involved.

Comments and suggestions on how to proceed with integraton of
multipart/form-data into HttpClient would be most welcome. Meanwhile, I'll
fiddle with my multipart encoder as a sandbox/fileupload test component.

--
Martin Cooper


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: [HttpClient] Adding support for multipart/form-data

Posted by Davanum Srinivas <di...@yahoo.com>.
Martin,

Please take a look at http://marc.theaimsgroup.com/?l=jakarta-commons-dev&m=101140281926454&w=2.
The code there can be used as a starting point.

Thanks,
dims

--- Martin Cooper <ma...@tumbleweed.com> wrote:
> I've been looking at the HttpClient code recently, with a view to adding
> support for the 'multipart/form-data' content type for the 'post' method.
> Amongst other things, this would allow HttpClient to be used for file
> uploads, in addition to regular requests using this (frequently used)
> content type.
> 
> Unfortunately, unless I'm mistaken (I hope I am!), it seems that support for
> this content type will require significant changes throughout the HttpClient
> code base. The problem is that the current code assumes that the value for a
> given request parameter is always a String. While this may be sufficient for
> other methods and encoding types, it does not provide enough information for
> the 'post' method when 'multipart/form-data' is involved.
> 
> Comments and suggestions on how to proceed with integraton of
> multipart/form-data into HttpClient would be most welcome. Meanwhile, I'll
> fiddle with my multipart encoder as a sandbox/fileupload test component.
> 
> --
> Martin Cooper
> 
> 
> --
> To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
> For additional commands, e-mail: <ma...@jakarta.apache.org>
> 


=====
Davanum Srinivas - http://xml.apache.org/~dims/

__________________________________________________
Do You Yahoo!?
Yahoo! Health - Feel better, live better
http://health.yahoo.com

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>