RE: PUT and entity
Hi all, After reading the REST discussion thread again, here is a summary of the various arguments given by participants: - Use zero-length entities instead. (Jon Hanna) - Maybe an indication that another resource/representation design is preferable (Bruno Harbulot) - It seems harder to be consistent in modeling the application state by interpreting the meaning of a non-existing resource (Bruno Harbulot) - Mapping 200 OK = allow and 404 Not Found = deny is an abuse of HTTP response codes (Brian Smith) - The absence of a resource is explicitly devoid of meaning in HTTP (Aristotle Pagaltzis) For the last point, an alternative would be to use a Boolean value/representation to represent the presence or absence of the right, instead of relying on HTTP status codes. My conclusion is that the support of PUT with no entity is not necessary for now in Restlet. Any other opinion? Best regards, Jerome -Message d'origine- De : Jerome Louvel [mailto:[EMAIL PROTECTED] Envoye : jeudi 29 mai 2008 11:20 A : discuss@restlet.tigris.org Objet : RE: PUT and entity Hi Jim, I have just sent an email to the REST discuss list. Let's see what comes out of it to decide what to do: http://thread.gmane.org/gmane.comp.web.services.rest/8046 If no one says it is forbidden, we'll allow it technically in the framework. Best regards, Jerome -Message d'origine- De : Jim Alateras [mailto:[EMAIL PROTECTED] Envoye : jeudi 29 mai 2008 00:04 A : discuss@restlet.tigris.org Objet : Re: PUT and entity Rhett, Yes, forgot i asked this question before. IMHO i wouldn't encode the 'put MUST have a non-null entity) policy in the framework. If you do then you should provide for a mechanism to override it (allowNullEntity or something). From my reading of the HTTP spec doesn't specify that a PUT *MUST* have an entity although i agree that in most cases that would be the case. In my particular case the URL includes all the information required to create the resource but i have to stick in a non-null entity body to get this to work with the framework cheers /jima On 27/05/2008, at 12:37 PM, Rhett Sutphin wrote: Hi Jim, On May 26, 2008, at 7:09 PM, Jim Alateras wrote: Any reason why, i nthe restlet framework, a PUT expects to have an entity. When i issue a PUT with an empty entity i get a 400 response. Last time you asked this question ( http://restlet.tigris.org/servlets/ReadMsg?list=discussmsgNo=5132 ), I pointed you to an earlier discussion ( http://restlet.tigris.org/servlets/ReadMsg?listName=discussmsgNo=3902 ). The summary is: the HTTP spec is vague, but most implementations expect PUTs to have an entity. For more details, read that second-linked thread. Is there something in particular that was unclear or that you disagreed with? Rhett cheers /jima
Re: PUT and entity
On Wednesday 2008.06.11, at 01:11 , Jerome Louvel wrote: [...] My conclusion is that the support of PUT with no entity is not necessary for now in Restlet. Any other opinion? I concur. It's totally nonsensical to have no entity at all for a put. That's like trying to put a null into a collection. The semantics are clear for an attempt to delete and for the put all empty values cases so there's no need at all. Take care, John
RE: PUT and entity
Hi Jim, I have just sent an email to the REST discuss list. Let's see what comes out of it to decide what to do: http://thread.gmane.org/gmane.comp.web.services.rest/8046 If no one says it is forbidden, we'll allow it technically in the framework. Best regards, Jerome -Message d'origine- De : Jim Alateras [mailto:[EMAIL PROTECTED] Envoye : jeudi 29 mai 2008 00:04 A : discuss@restlet.tigris.org Objet : Re: PUT and entity Rhett, Yes, forgot i asked this question before. IMHO i wouldn't encode the 'put MUST have a non-null entity) policy in the framework. If you do then you should provide for a mechanism to override it (allowNullEntity or something). From my reading of the HTTP spec doesn't specify that a PUT *MUST* have an entity although i agree that in most cases that would be the case. In my particular case the URL includes all the information required to create the resource but i have to stick in a non-null entity body to get this to work with the framework cheers /jima On 27/05/2008, at 12:37 PM, Rhett Sutphin wrote: Hi Jim, On May 26, 2008, at 7:09 PM, Jim Alateras wrote: Any reason why, i nthe restlet framework, a PUT expects to have an entity. When i issue a PUT with an empty entity i get a 400 response. Last time you asked this question ( http://restlet.tigris.org/servlets/ReadMsg?list=discussmsgNo=5132 ), I pointed you to an earlier discussion ( http://restlet.tigris.org/servlets/ReadMsg?listName=discussmsgNo=3902 ). The summary is: the HTTP spec is vague, but most implementations expect PUTs to have an entity. For more details, read that second-linked thread. Is there something in particular that was unclear or that you disagreed with? Rhett cheers /jima
RE: PUT and entity
Hi Matthias, I fully agree with your description. POP3 and SMTP are also stateful protocols. Best regards, Jerome -Message d'origine- De : Matthias Wauer [mailto:[EMAIL PROTECTED] Envoyé : mardi 27 mai 2008 23:17 À : discuss@restlet.tigris.org Objet : RE: PUT and entity Jerome Louvel schrieb: ... and I can see how to can be extended to FTP and many other ones. Of course the quality of the mapping depends on the type of protocol/scheme, for example whether or not it is stateless. Just to make that clear, FTP is _not_ a stateless protocol. As Richardson and Ruby have pointed out in their RESTful Web Services book, it is absolutely stateful. However, the specific use case of retrieving files using the ftp:// URI scheme can be considered stateless. I know it's nitpicking, but worth to mention anyway I think. Btw, thanks for the details on 204, good to know. Have a good night, Matthias
Re: PUT and entity
Rhett, Yes, forgot i asked this question before. IMHO i wouldn't encode the 'put MUST have a non-null entity) policy in the framework. If you do then you should provide for a mechanism to override it (allowNullEntity or something). From my reading of the HTTP spec doesn't specify that a PUT *MUST* have an entity although i agree that in most cases that would be the case. In my particular case the URL includes all the information required to create the resource but i have to stick in a non-null entity body to get this to work with the framework cheers /jima On 27/05/2008, at 12:37 PM, Rhett Sutphin wrote: Hi Jim, On May 26, 2008, at 7:09 PM, Jim Alateras wrote: Any reason why, i nthe restlet framework, a PUT expects to have an entity. When i issue a PUT with an empty entity i get a 400 response. Last time you asked this question ( http://restlet.tigris.org/servlets/ReadMsg?list=discussmsgNo=5132 ), I pointed you to an earlier discussion ( http://restlet.tigris.org/servlets/ReadMsg?listName=discussmsgNo=3902 ). The summary is: the HTTP spec is vague, but most implementations expect PUTs to have an entity. For more details, read that second-linked thread. Is there something in particular that was unclear or that you disagreed with? Rhett cheers /jima
RE: PUT and entity
Jerome Louvel schrieb: ... and I can see how to can be extended to FTP and many other ones. Of course the quality of the mapping depends on the type of protocol/scheme, for example whether or not it is stateless. Just to make that clear, FTP is _not_ a stateless protocol. As Richardson and Ruby have pointed out in their RESTful Web Services book, it is absolutely stateful. However, the specific use case of retrieving files using the ftp:// URI scheme can be considered stateless. I know it's nitpicking, but worth to mention anyway I think. Btw, thanks for the details on 204, good to know. Have a good night, Matthias