Re: Status Code/Entity body encoded in XML

Stanley Guan wrote:

> Hi,
>  
> What's the rule of thumb to find out there is an XML payload
> in the entity body?  In the following examples,
>     1. Status code alone doesn't provide the clue
>         However, the spec. says that:
>            "Based on returned status code, the client can
>             always take a resonable course of action."
>     2. Content-Type seems to be the clue.
>  
> What's the guideline for the server to return an XML payload
> in the entity body?  Say, for the PROPFIND, can it returns
> 200 (instead of 207) as status code and returns the property
> value like:
>    <?xml version="1.0" encoding="utf-8" ?>
>    <D:prop xmlns:D="DAV:">
>    ...
>    </D:prop>
>  
> Will appreciate your clarification!

1) PROPFIND never returns a 200 code.

2) If a method returns 207, the content type MUST be */xml, and the 
response must have a DAV:multistatus root element.

3) Servers *may* return a */xml response for 4xx and 5xx status codes, 
in which case a client can test for a DAV:error root element or a 
DAV:multistatus element to extract more information.

Julian

-- 
<green/>bytes GmbH -- http://www.greenbytes.de -- tel:+492512807760

Received on Tuesday, 4 November 2003 13:49:19 UTC