On 2011-03-16 12:17:51 +0100, Martin Bähr wrote:
> On Wed, Mar 16, 2011 at 10:57:26AM +0100, Rolf Johansson wrote:
> > Yes, but that is for a multipart/form-data with the image data attached to 
> > a parameter. The client I'm coding for (an Android app) can't use that 
> > content type without importing a whole lot of external apache libs, but 
> > can provide an image/* and POST it to me.
> 
> you are not coding the client?
> where is this client coming from?
> i don't see why it should need extra libs just to write different
> headers into the request...

It's not just different headers. A multipart/form-data must be a valid
multipart MIME message with appropriate separators, headers for each
part, etc. It isn't very complex (and IMHO support for it should be
included in any HTTP client library since it's one of two common forms
for POST requests), but there are some caveats (for example, you must
make sure that the separator doesn't occur in the file you try to
upload).

If you just send a file as the body of a POST request, it's much
simpler. But browsers never do this, so server-side support may be
lacking (the Perl CGI module supports it: To the user of the module it
looks as if there was a single parameter named "POST_DATA").

        hp

-- 
   _  | Peter J. Holzer    | Auf jedem Computer sollte der Satz Ludwigs II
|_|_) | Sysadmin WSR       | eingeprägt stehen: "Ein ewig Rätsel will ich
| |   | [email protected]      | bleiben, mir und andern."
__/   | http://www.hjp.at/ |    -- Wolfram Heinrich in desd

Attachment: signature.asc
Description: Digital signature

Reply via email to