POSTing multipart/form-data

Lane Stevens lane at cycletime.com
Tue Aug 29 00:39:33 EDT 2000


I am writing an http test driver that must post data to an http server
to be
handled by cgi scripts.  The question is this:  How do I post
multipart/form-data data?

The problem is if I post the data through NN, it seems to work fine.  If
I
post the data through my driver, the HTTP server times out and and
doesn't seem
to know when the data are complete.  It was my understanding that the
boundary marker followed by "--" is used to signal the end of the
multipart/form-data submission.

Other background is that I am using the httplib.py Python module to
coordinate the conversation between the client and the server.


Between the <example> tags is an example of what I am doing.
<example>
POST /cgi-bin/script HTTP/1.0
Content-type: multipart/form-data, boundary=The_Boundary_$

--The_Boundary_$
Content-disposition: form-data; name="testdata"

Some data go here
--The_Boundary_$--
</example>


A related question is:  Can Apache be configured to dump all of its
conversations to a log file?  This would provide an alternative way for
me
to determine the difference between what NN does and what my test driver

does as seen by the server.

Any help, pointers, etc. would be greatly appreciated.

Thanks,
Lane.





More information about the Python-list mailing list