-
Notifications
You must be signed in to change notification settings - Fork 423
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
can we pass user defined content type/format using flag COAP_OPTION_CONTENT_FORMAT #1520
Comments
Content-Format is an integer value when held in a CoAP Message in the Content-Format CoAP Option. It is up to the transmitter of the request response message generator as to what integer value is used, and up to the message receiver to get the integer option and use it for the appropriate purpose. The currently defined set of known (IANA registered) content-formats can be found at CoAP Content Type. While the whole set of integer values (as defined by IANA) can be used by libcoap for message transmission / receipt, only a subset of the names are printed out by the libcoap debug in libcoap does not care if you use an un-assigned integer value. So, you can locally define things like There is nothing to stop you to use a locally defined COAP_MEDIA_TYPE_* (that does not clash with any of the IANA definition integer values) for your particular application requirements.
|
Hello Team,
We are currently using libcoap in our project and have encountered a scenario where we would like to utilize the PUT method from the client-side while specifying a custom content format in the CoAP headers using the COAP_OPTION_CONTENT_FORMAT option.
It would be beneficial if libcoap allowed for user-defined content formats, such as application/x.myapp.api.Add.v0.1.0+json, in addition to the standard IANA registered media types.
Enhancement Request:
Feature: Allow the use of user-defined content formats in the COAP_OPTION_CONTENT_FORMAT option.
Use Case: We aim to define and use content formats specific to our application’s API, like application/x.myapp.api.Add.v0.1.0+json, for structured data exchange in CoAP messages.
Impact: This feature would provide greater flexibility for developers to specify and use custom content types based on the version and type, enhancing the ability to support application-specific APIs within CoAP communication.
Thank you for considering this request. We believe this feature would significantly improve the adaptability of libcoap for custom application protocols.
The text was updated successfully, but these errors were encountered: