Java Reference
In-Depth Information
Even if the server accepts this request, its response is implementation dependent. Some
servers may delete the file; others simply move it to a trash directory. Others simply
mark it as not readable. Details are left up to the server vendor.
PUT
Many HTML editors and other programs that want to store files on a web server use
the PUT method. It allows clients to place documents in the abstract hierarchy of the site
without necessarily knowing how the site maps to the actual local filesystem. This con‐
trasts with FTP, where the user has to know the actual directory structure as opposed
to the server's virtual directory structure. Here's a how an editor might PUT a file on a
web server:
PUT /blog/wp-app.php/service/pomdoros.html HTTP/1.1
Host: www.elharo.com
Authorization: Basic ZGFmZnk6c2VjZXJldA==
Content-Type: application/atom+xml;type=entry
Content-Length: 329
If-Match: "e180ee84f0671b1"
<?xml version="1.0" ?>
<entry xmlns="http://www.w3.org/2005/Atom">
<title>The Power of Pomodoros</title>
<id>urn:uuid:1225c695-cfb8-4ebb-aaaa-80da344efa6a</id>
<updated>2013-02-23T19:22:11Z</updated>
<author><name>Elliotte Harold</name></author>
<content>Until recently, I hadn't paid much attention to...</content>
</entry>
As with deleting files, some sort of authentication is usually required and the server
must be specially configured to support PUT . The details vary from server to server. Most
web servers do not support PUT out of the box.
OPTIONS
The OPTIONS request method asks what options are supported for a particular URL. If
the request URL is an asterisk (*), the request applies to the server as a whole rather
than to one particular URL on the server. For example:
OPTIONS /xml/ HTTP/1.1
Host: www.ibiblio.org
Accept: text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2
Connection: close
The server responds to an OPTIONS request by sending an HTTP header with a list of
the commands allowed on that URL. For example, when the previous command was
sent, here's what Apache responded with:
HTTP/1.1 200 OK
Date: Sat, 04 May 2013 13:52:53 GMT
Server: Apache
Search WWH ::




Custom Search