OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

obix-xml message

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]


Subject: Re: [obix-xml] Content Negotiation


I was debating that we should use 406 if the Client does a GET with an unsupported Accept header, and use 415 if the Client does a PUT/POST with an unsupported Content-Type.

But it seems better to use a consistent response code, which is how I have it now.

It was also unclear how to actually include the supported MIME types in the 406 error 

I am open to suggestions


On Thu, Nov 12, 2009 at 1:49 PM, Richards, Dave <drichards@trane.com> wrote:

Looking at the 406/415 definitions, I think the 415 is if the client sends data in a format not acceptable to the server.  406 is if the server cannot satisfy the request in a format acceptable to the client which is the case you describe in the CONTENT negotiation section.

 


From: Brian Frank [mailto:brian.tridium@gmail.com]
Sent: Thursday, November 12, 2009 12:37 PM
To: obix-xml@lists.oasis-open.org; brian.tridium@gmail.com
Subject: [obix-xml] Content Negotiation

 

Reading thru the HTTP spec it was a little unclear to me when to use 406 for 415 status codes.  But here is what I came up with regarding content negotiation.  Feedback welcome.

 

Contention Negotiation

oBIX resources may be encoded using either the “text/xml“ or the “application/x-obix-binary“ MIME types.  Clients and servers SHOULD follow Section 12 of RFC 2616 for content negotiation.

 

If a client wishes to GET a resource using a specific encoding, then it SHOULD specify the desired MIME type in the Accept header.

 

If the server does not support the MIME type of a client request, then it SHOULD respond with the 406 Not Acceptable status code.  There are two use cases for a 406 failure: 1) the client specifies an unsupported MIME type in the Accept header of a GET (read) request, or 2) the client specifies an unsupported MIME type in the Content-Type of a PUT (write) or POST (invoke) request.

 
The information contained in this message is privileged and intended only for the recipients named. If the reader is not a representative of the intended recipient, any review, dissemination or copying of this message or the information it contains is prohibited. If you have received this message in error, please immediately notify the sender, and delete the original message and attachments.



[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]