Patch for PUT and DELETE inets HTTP methods support

View: New views
2 Messages — Rating Filter:   Alert me  

Parent Message unknown Patch for PUT and DELETE inets HTTP methods support

by Michal Ptaszek :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi,

In the times of RESTful addressing style it is a very inconvenient situation where when one wants to remove something on the server side must use 'POST' method instead of simple 'DELETE'.

Are there any plans to widen the set of accepted HTTP methods?

As far as I have understood the inets source code, RFC (http://www.w3.org/Protocols/rfc2616/rfc2616.html) and the patched server responses, those few lines I am attaching should solve the problem.

Best regards,
--
Michal Ptaszek
www.erlang-consulting.com

[httpd_request.erl.patch]

--- httpd_request.erl 2009-02-09 10:54:30.000000000 +0100
+++ httpd_request.erl.back 2009-02-09 10:36:57.000000000 +0100
@@ -88,10 +88,6 @@
     validate_uri(Uri);
 validate("TRACE", Uri, "HTTP/1." ++ N) when hd(N) >= $1 ->
     validate_uri(Uri);
-validate("DELETE", Uri, "HTTP/1." ++ _N) ->
-    validate_uri(Uri);
-validate("PUT", Uri, "HTTP/1." ++ _N) ->
-    validate_uri(Uri);
 validate(Method, Uri, Version) ->
     {error, {not_supported, {Method, Uri, Version}}}.
 


_______________________________________________
erlang-patches mailing list
erlang-patches@...
http://www.erlang.org/mailman/listinfo/erlang-patches

Re: Patch for PUT and DELETE inets HTTP methods support

by Jan Lehnardt-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


On 9 Feb 2009, at 11:10, Michal Ptaszek wrote:

> In the times of RESTful addressing style it is a very inconvenient  
> situation where when one wants to remove something on the server  
> side must use 'POST' method instead of simple 'DELETE'.
>
> Are there any plans to widen the set of accepted HTTP methods?

We shipped our own patched version of inets to fix that back in the
day with CouchDB. I agree that this is a useful addition. Also, if you
are considering my patch about the WebDAV extension methods,
you'd most likely want to update this list as well.

Cheers
Jan
--

_______________________________________________
erlang-patches mailing list
erlang-patches@...
http://www.erlang.org/mailman/listinfo/erlang-patches