Hi all,

This is indeed an edge case, but there isn't anything in HTTP spec that
prevents you from POSTing without an entity.

I've changed the Resource class to accept those requests, just logging a
trace (FINE level) for debugging purpose. As it is an API contract change, I
have only committed this to SVN trunk.

BTW, we hope to have Restlet 1.1 M1 released in the coming weeks:
http://www.restlet.org/about/roadmap

Best regards,
Jerome  

> -----Message d'origine-----
> De : Adam Taft [mailto:[EMAIL PROTECTED] 
> Envoyé : mercredi 1 août 2007 21:42
> À : [email protected]
> Objet : Re: POST w/o an entity not allowed?
> 
> 
> I do a POST without an entity, and I think there are valid 
> use cases for 
> it (albeit these are edge cases).
> 
> In order to do so, I had to override the handlePost() method 
> to accept 
> empty request bodies (bypassing that isEntityAvailable() check).
> 
> I don't think there's anything unrestful in doing this, nor 
> contrary to 
> the HTTP spec.
> 
> I'm assuming you're using a web browser client, because an 
> "adjustment" 
> to an existing resource would imply PUT, right?  But, as we know, 
> PUT/DELETE sucks on web browsers.
> 
> Adam
> 
> 
> Sean Landis wrote:
> > We are creating a web service as follows:
> > 
> > http://host/inventoryManager/{product_id}?adjust={n}
> > 
> > This will adjust inventory for a particular product. 
> RESTfully, this should be a
> > POST. We have all the scoping info in the URI in a form 
> recommended by 
> > "RESTful Web Services" in the case of an algorithmic resource. 
> > 
> > Unfortunately, Restlet does not allow POST with an empty 
> body, or a body with
> > zero length. The test occurs in Message.isEntityAvailable() 
> and is called 
> > in the POST case from Request.isEntityAvailable.
> > 
> > I haven't seen anywhere that it is unRESTful to have an 
> empty entity. Is this
> > a W3C constraint? Or just a RESTlet constraint? Does it make sense?

Reply via email to