| How to add Header to CoAP request [message #1740397] |
Fri, 12 August 2016 09:58  |
Eclipse User |
|
|
|
Hi all,
I am new in this CoAP topic and I am implementing OM2M platform which is a Java-based implementation to provide machine-to-machine services, based on ETSI-M2M/oneM2M standard. And in this OM2M standard, it support users to send both HTTP and CoAP requests to perform services. However, OM2M requires an authorization username and password in the request header, such as: Header key: value. When I tried with HTTP, it is possible to add header to the request using available plugin REST Client. When I moved to CoAP, I used Californium with simple CoAP client to send GET request to the OM2M:
CoapClient client = new CoapClient(uri)
client.get();
but I receive error 4.03 because the OM2M requires authorization in the header but and I dont know how to put this header to the CoAP request.
Does anyone have an idea how can I put header to a CoAP Get/Post request?
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.04084 seconds