[wp-hackers] HTTP Request API edge case

Jacob Santos wordpress at santosj.name
Sun Jul 19 22:45:47 UTC 2009


You are forgiven for the misunderstanding as I might not have been clear enough. The point I was trying to make was that all existing HTTP methods are uppercase, or at least those that servers understand or can be made to understand (like WebDAV and mod_dav_svn).

Alas, I said nothing of exclusion other than server support, which the HTTP API has no control over. The HTTP API must never exclude you from using a method, even if the method you are using is incorrect or not supported. The most that would happen is that the server will kick it back or not do anything.

I attempting to stay out of the discussion as to whether we should help people are send the incorrect method. If they use the *_post(), *_get(), or *_head(), then the method will always be set correctly. If you are using another method, then it is up to you to do so correctly, else you shouldn't be using it at all.

Jacob Santos


On Sun, 19 Jul 2009 14:21:55 -0500 (CDT)
Mike Schinkel <mikeschinkel at newclarity.net> wrote:

> "Heiko Rabe" <heiko.rabe at code-styling.de> wrote:
> > excluding PUT would not a good idea
> 
> +100
> 
> DELETE is also needed. Without it you can't create a RESTful web service [1][2][3].
> 
> "Jacob Santos" <wordpress at santosj.name> wrote:
> > or one of the HTTP 1.1,
> 
> Or did we misunderstand?  By saying HTTP 1.1 were you implying PUT and DELETE?  If so, forgive the intrusion.
> 
> -Mike Schinkel
> Custom Wordpress Plugins
> http://mikeschinkel.com/custom-wordpress-plugins
> 
> [1] http://www.artima.com/lejava/articles/why_put_and_delete.html
> [2] http://www.xml.com/pub/a/2004/12/01/restful-web.html
> [3] http://en.wikipedia.org/wiki/Representational_State_Transfer#RESTful_example:_the_World_Wide_Web
> 
> 
> ----- Original Message -----
> From: "Heiko Rabe" <heiko.rabe at code-styling.de>
> To: wp-hackers at lists.automattic.com
> Sent: Sunday, July 19, 2009 3:13:03 PM GMT -05:00 US/Canada Eastern
> Subject: Re: [wp-hackers] HTTP Request API edge case
> 
> I think, that excluding PUT would not a good idea, because the cloud 
> computing from Microsoft's Azure Platform 
> http://www.microsoft.com/azure/default.mspx needs as example for azure 
> blobs a PUT.
> Most of this services can be used RESTful and HTTP/HTTPS based, so this 
> may also be a future option to integrate useful services into WP out of 
> the clouds.
> 
> regards
> 
> > No, there aren't any methods that currently exist that are mixed case or lower case. All existing methods are uppercase. That is not to say that there couldn't be or won't be in the future. It is also to say that most of the time, we should be doing POST, GET, or HEAD. All of the others such as PUT, have no guarantee to be supported on the server we are requesting, and most likely would be blocked from doing a PUT request.
> >
> > Furthermore, if someone is using a non-standard method, they either know what they are doing, or should not be doing it. Alas, such things should probably be in a header than a method as the server probably won't know what to do with it otherwise. There is a reason DAV requires an extension, is that it is an extension to the HTTP 1.1 standard and not part of it.
> >
> > So in conclusion, if someone is doing something other than POST, GET, HEAD, or one of the HTTP 1.1, then they are doing it wrong and therefore we can safely uppercase the method.
> >
> >   
> 
> _______________________________________________
> wp-hackers mailing list
> wp-hackers at lists.automattic.com
> http://lists.automattic.com/mailman/listinfo/wp-hackers
> _______________________________________________
> wp-hackers mailing list
> wp-hackers at lists.automattic.com
> http://lists.automattic.com/mailman/listinfo/wp-hackers


-- 
Jacob Santos <wordpress at santosj.name>



More information about the wp-hackers mailing list