2006/4/26, Mark Baker <[EMAIL PROTECTED]>:
> Sure, but at the cost of removing the possibility of future
> extensibility, profiling HTTP, and requiring bandwidth be wasted in
> many cases.
>
> But MUST for an optimization?  If you specified nothing here, then
> servers would have the option of returning the entry if that something
> they felt their clients needed, or a particular interaction required,
> or had otherwise negotiated with an authenticated client.  But they'd
> also have the option of returning anything else, or nothing at all,
> should some yet-to-be-defined feature want to do so in the future.
> And as you say, they can always GET if they need to.

+1

"If the server includes a body in the response and it is an Atom Entry
Document, it MUST be representing the newly-created resource. Clients
MUST NOT assume that an Atom Entry returned is a full representation
of the member resource and SHOULD perform a GET on the member resource
before editing."

– or –

"The server MAY return the Atom Entry representing the newly-created
resource in the response body. If it does so, it MUST then include a
Content-Location header with the same value as the Location header.
Clients MUST NOT assume that such an Atom Entry is a full
representation of the member resource and SHOULD perform a GET on the
member resource before editing. Any Atom Entry Document returned in
the response body without an accompanying Content-Location header, or
with a Content-Location header whose value is different from the
Location header MUST NOT be treated as a representation of the newly
created resource."

The second has the advantage of allowing servers to return some
information as an Atom Entry without it representing the newly-created
resource, e.g.:

HTTP/1.1 201 Created
Location: http://app.example.net/entry/1
Content-Type: application/atom+xml
Content-Length: nnn

<entry xmlns="…">
    <title>Your article has been submitted</title>
    <id>tag:app.example.net,2006-04-26:success-231</id>
    <author><name>Submission Bot</name></author>
    <link rel="related" href="http://app.example.net/entry/1";
title="Your article" />
    <content type="xhtml"><div xmlns="…">
        <p>Your article has been submitted. It will be reviewed by our
staff before being published or rejected.</p>
        <p>You can follow the whole process at the following URI:
            <a 
href="http://app.example.net/entry/1";>http://app.example.net/entry/1</a>.</p>
    </div></content>
</entry>

--
Thomas Broyer

Reply via email to