Re: POST with empty body

On Thu, Sep 02, 2010 at 11:14:22PM +0200, Jan Algermissen wrote:
> 
> On Sep 2, 2010, at 10:49 PM, David Morris wrote:
> 
> > 
> > 
> > On Thu, 2 Sep 2010, Darrel Miller wrote:
> > 
> >> In the description of POST here [1], it starts with:
> >> 
> >> "The POST method is used to request that the origin server accept the
> >> representation enclosed in the request as data to be processed by the
> >> target resource."
> 
> Wouldn't an empty POST body make the above equivalent to 'do something'? And wouldn't that equate to method tunneling?
> (along the lines of POST [empty] to /orders/42/ship )

According to p1-11 page 23 :
   5.  If this is a request message and none of the above are true, then
       the message-body length is zero (no message-body is present).

so a POST with no content-length and no body is equivalent to a POST
with Content-Length: 0 and nothing following, as could perfectly happen
when you upload an empty file for instance. The resource is determined
by the URL and the server has to know how to handle the body, including
if it's empty. I don't see the issue here in fact :-/

Willy

Received on Thursday, 2 September 2010 21:31:05 UTC