PUT and DELETE support
This page summarizes the client and server side support for the HTTP methods PUT and DELETE. The contents of this page was earlier to be found in CarrotVsOrange, but is moved here to have the tests and results more easilly available.
Server-Side Platform support of PUT and DELETE
The main issue behind this discussion is centered around whether platforms support the additional HTTP and/or WebDav methods. This question of support is one that needs further investigation.
Note: The context of this question is a Atom Publishing System, not a web server, site as a whole, or some particular directory path within a site. Specifically: if you can run an Atom publishing system at a "gateway" URL using GET/POST can you not also run the same "gateway" URL as a URL-space with GET/PUT/DELETE/POST underneath it.
-
Apache: atom.cgi
-
Python CGI server
-
Coldfusion: incoming PUT and DELETE?
-
Perl atomrest.pl
-
PHP:
-
PHP/4.3 atom.php (PHP/4.3.2 Apache/1.3.28 Red Hat/7.2 )
-
PHP can extract the XML data from a POST without needing always_populate_raw_post_data enabled using php://input.
-
PHP prior to 4.3 atom.php 405 Method Not Allowed
-
[MikeDavies] PUT request does work on PHP/4.0.6, Apache 1.3.x on Windows. I originally started developing using this setup and it handled PUT request fine. What I couldn't do was extract the raw HTTP entity body, since that required a specific configuration change of always_populate_raw_post_data set to 1. Is the problem that's causing the frown not an Apache 2.x default configuration problem?
-
Java: The Servlet spec exlicitly supports all the verbs by extending HttpServlet, and retrieve the XML using HttpServletRequest.getReader()
-
ASP: RestAspExample
-
ASP.NET: RestAspNetExample
Client-Side Platform support of PUT and DELETE
-
Note: The urllib2 module defines functions and classes which help in opening URLs (mostly HTTP) in a complex world -- basic and digest authentication, redirections and more.
-
Perl: HTTP::Request, XML-Atom
-
Ruby:
-
CF.http -- all versions prior to CF MX 6.1 do not natively support outgoing PUT and DELETE
-
cURL: curl -X PUT -T data.file http://host.domain/path or curl -X DELETE http://host.domain/path (--request also works in place of -X)
-
ASP: RestAspExample
-
ASP.NET: RestAspNetExample
-
JavaScript and DHTML: client
-
Using XML HTTP Request supported on Internet Explorer and Mozilla (Safari 1.1 now supports XML HTTP Request, also Opera 7.6 is starting to support it). The one drawback of using XML HTTP Request is that, like applets, it looks like you can only connect to the server the client script came from. blogged. Gmail uses XML HTTP Request extensively in its client interface
-
WAP: ? What about WAP/WML and other mobile environments?
-
Java:
-
HTTPClient v0.03 This is not the Apache HTTPClient, but an earlier project by the same name. It has a friendly LGPL license, which explicitly states that use as a library is permitted (see the documentation for the license clarification statements). It provides a complete http client library supporting all methods and method extensions. I have used it extensively in developing a REST Web Services Framework for client requests and testing, see http://www.cognitiveweb.org/technology/projects/cweb/. Lately, I have been working on a client layer over this package to provide for secure delegation of the authority of the client and other such features.
-
Note: all "applets" are limited (POST or PUT/DELETE) for security reasons to only allow a connection back to the server it was delivered from, Applet Security FAQ. The main workaround is to use a proxy on the originating server WebReference: Getting out of the Sandbox: Building an Applet Proxy Server
-
/ :/ J2ME MIDP 1.0/2.0 Mobile Java does not support PUT or DELETE (only HttpConnection.GET and HttpConnection.POST.) Though there *might* be a work around by opening a direct socket, many phones do not support direct socket communications. Only HTTP connections are required in the MIDP 1.0 spec. Update: It's possible to do PUT/DELETE on phones that support SocketConnection/SecureSocketConnection. Most phones that have HTTPS support also provide these interfaces.
-
This question isn't relevant, as the spec is explicit about supported request methods, but how many implementations actually test and restrict the 'String method' passed to setRequestMethod()? Are there examples of any that allow any HTTP request method?
-
I can confirm non-working setRequestMethod("PUT") in Nokia 3650.
-
As suggested on Russ' blog: "why not simply create an HTTPConnection class that supports DELETE and PUT... In fact, just decompile the current j2me implementation"
-
Flash: Can PUT and DELETE be done in ActionScript?
-
Initial googling doesn't mention it. Relevant pages Flash XML.send sends as POST request, also there's a Flash XML FAQ
-
The Flash player does not support PUT and DELETE. It only has support for GET and POST.
-
[TimKnip] Check out the XMLSocket object. It guess it would be possible to send data like: XMLSocket.send("PUT /blog/1 HTTP1.1") UPDATE: Flash can't connect beyond own domain (security)...
-
Apple: WebKit on 10.4
-
Apple: WebKit on 10.2 and 10.3
-
Apple: CoreFoundation
-
Brew: ?
-
Palm: ?
-
Pocket PC: For .NET Compact Framework, "The HttpWebRequest class is capable of handling any of the HTTP 1.1 verbs: GET, PUT, POST, DELETE, TRACE, HEAD or OPTIONS."
-
Symbian: ?
Clients or Servers not able to use POST ''or'' PUT/DELETE for Atom API
The following are implementations where one might at first think, "oh, this one doesn't support PUT/DELETE", when in fact they are not capable of supporting the Atom protocol using POST, either.
-
DHTML using forms: A browser that strictly supports the W3C recommendations probably won't support PUT and DELETE. The HTML4.01 specification for the form element defines the list of allowable methods as get and post. So there's no requirement that they must or should be supported. Both POST and GET will be sent as a collection of name value pairs by default. This format can be changed by setting the enctype attribute on the form object. This enctype can be an encoding-type as specified in RFC2045 - yet the HTML4.01 specification only mentions two: application/x-www-form-urlencoded and multipart/form-data. MikeDavies did look down this route as a means of testing AtomAPI implementations, but basically got nowhere.
-
FormsAndPutDelete makes a distinction between using forms to progress a web application and forms to directly act on an identified resource.
-
wget: retrieval only.
-
Perl CGI.pm: geared towards HTML forms; mangles XML in POST, works somewhat with PUT/DELETE.
-
Perhaps we can approach the CGI.pm maintainers with the requirement that we can access the raw Entity Body?
-
Note: The CGI::Simple module, which is a pure perl drop in replacement for CGI as far as actual CGI goes supports PUT and POST with access to the raw entity body.
See also: http://curl.haxx.se/docs/comparison-table.html for a comparison of HTTP tools and capabilities.
Hosting Providers support of PUT and DELETE
The following are hosting providers capabilities for supporting PUT/DELETE:
-
Hurricane Electric (JohnPanzer) (Note: May still have Apache OPTIONS issue).