sufficient space to record the state of the resource after the
execution of this method.
502 (Bad Gateway) - This may occur when the destination is on another
server and the destination server refuses to accept the resource.
8.8.6 Example - COPY with Overwrite
This example shows resource
http://www.ics.uci.edu/~fielding/index.html being copied to the
location http://www.ics.uci.edu/users/f/fielding/index.html. The 204
(No Content) status code indicates the existing resource at the
destination was overwritten.
>>Request
COPY /~fielding/index.html HTTP/1.1
Host: www.ics.uci.edu
Destination: http://www.ics.uci.edu/users/f/fielding/index.html
>>Response
HTTP/1.1 204 No Content
8.8.7 Example - COPY with No Overwrite
The following example shows the same copy operation being performed,
but with the Overwrite header set to "F." A response of 412
(Precondition Failed) is returned because the destination resource
has a non-null state.
>>Request
COPY /~fielding/index.html HTTP/1.1
Host: www.ics.uci.edu
Destination: http://www.ics.uci.edu/users/f/fielding/index.html
Overwrite: F
RFC 2518 WEBDAV February 1999
>>Response
HTTP/1.1 412 Precondition Failed
8.8.8 Example - COPY of a Collection
>>Request
COPY /container/ HTTP/1.1
Host: www.foo.bar
Destination: http://www.foo.bar/othercontainer/
Depth: infinity
Content-Type: text/xml; charset="utf-8"
Content-Length: xxxx
<?xml version="1.0" encoding="utf-8" ?>
<d:propertybehavior xmlns:d="DAV:">
<d:keepalive>*</d:keepalive>
</d:propertybehavior>
>>Response
HTTP/1.1 207 Multi-Status
Content-Type: text/xml; charset="utf-8"
Content-Length: xxxx
<?xml version="1.0" encoding="utf-8" ?>
<d:multistatus xmlns:d="DAV:">
http://www.foo.bar/othercontainer/R2/
HTTP/1.1 412 Precondition Failed
</d:response>
</d:multistatus>
The Depth header is unnecessary as the default behavior of COPY on a
collection is to act as if a "Depth: infinity" header had been
submitted. In this example most of the resources, along with the
collection, were copied successfully. However the collection R2
failed, most likely due to a problem with maintaining the liveness of
properties (this is specified by the propertybehavior XML element).
Because there was an error copying R2, none of R2's members were
copied. However no errors were listed for those members due to the
error minimization rules given in section 8.8.3.
RFC 2518 WEBDAV February 1999
=23= |