RE: Problems with POST

Isabelle Delagarde wrote:

> I would like to POST data with format "a=b&c=d&..." followed by a MIME
> file : everything needs to be in the same request.

You should typically use the MIME transport encoding multipart/form-data in
accordance to RFC 1867 (I think it was). This transport encoding radically
(and beautifully) differs from the usual x-www-urlencoded
(this=that&such=encoded+spaces+and+stuff). The problem is, you have to
encode it in your client application, and you have to decode it in your
server application. Many servers have API:s or addons for doing this (such
as the upload COM objects for IIS, plugins for Apache etc).

All popular web browser clients does the trick, and libwww can do the server
decoding (as told by Henrik F at må 1999-01-25): 

> If you use one of the libwww profiles then you will get a MIME multipart
> parser for all multipart/* types. This is registered in 
>
>	http://www.w3.org/Library/src/HTInit.c
>
> in HTConverInit(), and you can find the MM parser in
>
>	http://www.w3.org/Library/src/HTBound.c
>
> The "range" sample program uses this to parse multipart/byteranges when
> issuing a request with multiple ranges:
>
>	http://www.w3.org/Library/Examples/range.c
>
> linked from
>
>	http://www.w3.org/Library/Examples/
>
> MM generation is not quite there - it depends on the hack that I am
working
> on for handling PUT and POST in small pieces. I hope to have that done in
a
> week or so.

If that MM generation is there now, you should also be able to construct
client calls with libwww. What do you say, Henrik?

Linus Walleij

Received on Friday, 5 March 1999 11:35:39 UTC