[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Specifying preference for no-content in responses
I've used a custom entity header for this:
Content-Response: {status-code}
Where {status-code} = 200,201,204
The server can treat this header the same as Content-Encoding; as a
suggestion that can be ignored.
I used this for an app that served clients that had bandwidth
constraints (handhelds, etc.).
If you want a more rigid version, you could use a request-style header:
Accept-Response: 200;q=.5,201;q=.2;*
Where the server can use negotiation to determine if the request can
be fulfilled. If the server does not support the requested option
(Accept-Response:204), 406 (Not acceptable) could be returned.
mca
http://amundsen.com/blog/
On Thu, Apr 1, 2010 at 02:25, Pablo Castro <Pablo.Castro@xxxxxxxxxxxxx> wrote:
>
> In Astoria ("OData" now [1]) we want to include entries in responses to POST/PUT requests so the server can send "fresh" values for parts of the entry or the whole thing. However, since sometimes clients may not need this and may want to avoid the extra bandwidth use, we'd like to let the client choose whether it wants a replay of the entry or just a 204 "No Content".
>
> Content-type negotiation comes to mind, but there doesn't seem to be a possible value for the Accept header that indicates "no content please". Both a missing accept header and an empty one have meaning already. Also, as far as I know there is no content type to represent no content.
>
> Has anybody ran into this need where a client issuing a POST or PUT wants to indicate whether or not the server should include a fresh entry in the response?
>
> Thanks
> -pablo
>
> [1] http://odata.org
>
>