[mod_python] util.FieldStorage wrong about method restrictions

Nic James Ferrier nferrier at tapsellferrier.co.uk
Mon Aug 14 07:30:50 EDT 2006

Jim Gallacher <jpg at jgassociates.ca> writes:

> It's my understanding that PUT is used for uploading binary objects such
> as files, without creating the MIME message usually associated with
> POST. FieldStorage really doesn't make sense in that context.
> I might be wrong though.

PUT is used for changing the entity pointed at by the URI.

But the entity could be represented as an XML document, a binary
object or as a list of fields.

Here is RFC2616, section 9.6, Page 55:

   The fundamental difference between the POST and PUT requests is
   reflected in the different meaning of the Request-URI. The URI in a
   POST request identifies the resource that will handle the enclosed
   entity. That resource might be a data-accepting process, a gateway to
   some other protocol, or a separate entity that accepts annotations.
   In contrast, the URI in a PUT request identifies the entity enclosed
   with the request -- the user agent knows what URI is intended and the
   server MUST NOT attempt to apply the request to some other

Really that is the only difference. Which is why both cgi.FieldStorage
and util.FieldStorage should allow PUT as well as POST.

Still, mod_python's wants to behave like cgi's. So I'll go talk to the
cgi people about changing their's first.


Nic Ferrier
http://www.tapsellferrier.co.uk   for all your tapsell ferrier needs

More information about the Mod_python mailing list