[gcs-pcs-list] Revisiting 415 vs 406

Xiaoming Liu liu_x at lanl.gov
Thu Mar 9 02:46:15 EST 2006


On Wed, 8 Mar 2006, Leigh Dodds wrote:

> (assigned a new subject line to keep discussion separate
> from voting)
>
>
> So typically a "415 Unsupported Media Type" would be returned by a
> server to which you'd POST'd (say) an Atom document and that
> server only understood RSS. And that doesn't fit the unAPI use
> case.
>
> "406 Not Acceptable" is defined for use where the client wants a
> specific format and the server can't provide it. Reading, 
> http://rfc.net/rfc2616.html#p67 we get:
>
> The resource identified by the request is only capable of
> generating response entities which have content characteristics
> not acceptable according to the accept headers sent in the
> request.
> "
>
> Which seems a good fit for an unAPI implementation not being able
> to fulfill a particular FORMAT request.
>
> That section also includes some best practice advice:
>
> "
> ...the response SHOULD include an entity containing a list of
> available entity characteristics and location(s) from which
> the user or user agent can choose the one most appropriate.
> "
>
> So you might want to consider encouraging implementations
> to return the 406 status code AND the same response body
> as they would for GET UNAPI?uri=URI, i.e. the list of
> available formats for that URI.
>
> "Sorry guv, can't do that, try one of these instead" :)
>


Thanks for the clear analysis, I got a better understanding now. Agree 415 
is not appropriate in this case.

But Dan's concern about 406 still remains:

> Note that we are not currently addressing accept headers in unAPI
> (not that it hasn't come up :).

400 is perhaps another candidate but too broad:
10.4.1 400 Bad Request
    The request could not be understood by the server due to malformed
    syntax. The client SHOULD NOT repeat the request without
    modifications.

I guess discussion will go on with this issue.

xiaoming


More information about the gcs-pcs-list mailing list