-
Notifications
You must be signed in to change notification settings - Fork 69
Automatic content negotiation #3
Comments
…Added an interface AcceptSupport and a default implementation AcceptDefaultSupport and a JUnit test. A CoapResource now has an AcceptSupport object. If a resource defines some specific formats that are being accepted and the request asks for another format, the resource automatically responds with a 4.06.
I have implemented a proposal for this issue (https://github.com/Lanterm/californium/tree/accept-and-etag). I have added an interface AcceptSupport and a default implementation AcceptDefaultSupport. Each resource has such an object. By default, the support object lets any request pass and it will be up to the code in handleGET() to process it. This is exactly the behavior as of now. However, if the resource calls for instance I did not choose to make this a layer in the CoapStack because it is not yet clear at this stage which resource is going to be the target, and therefore which content format it supports. |
…Added an interface AcceptSupport and a default implementation AcceptDefaultSupport and a JUnit test. A CoapResource now has an AcceptSupport object. If a resource defines some specific formats that are being accepted and the request asks for another format, the resource automatically responds with a 4.06.
…Added an interface AcceptSupport and a default implementation AcceptDefaultSupport and a JUnit test. A CoapResource now has an AcceptSupport object. If a resource defines some specific formats that are being accepted and the request asks for another format, the resource automatically responds with a 4.06.
Content-Format and Accept handling is currently fully up to the resource implementer. Californium could provide an Accept option check before delivering requests or check the Content-Format after a request was processed and could automatically react with 4.06 Not Acceptable.
This could be added as Layer for the CoapStack.
The text was updated successfully, but these errors were encountered: