Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Californium (Cf) CoAP Framework » How to add Header to CoAP request
How to add Header to CoAP request [message #1740397] Fri, 12 August 2016 13:58 Go to next message
Son Duong is currently offline Son DuongFriend
Messages: 60
Registered: June 2016
Member
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?
Re: How to add Header to CoAP request [message #1741252 is a reply to message #1740397] Wed, 24 August 2016 07:52 Go to previous messageGo to next message
Muhammad Shoaib is currently offline Muhammad ShoaibFriend
Messages: 21
Registered: March 2016
Junior Member
Hi Son Duong,
Can you guide me to californium tutorial for server or client? I tried Google but still wandering aimlessly
Re: How to add Header to CoAP request [message #1742483 is a reply to message #1741252] Fri, 02 September 2016 10:21 Go to previous message
Son Duong is currently offline Son DuongFriend
Messages: 60
Registered: June 2016
Member
Hi Muhammad,

sorry for the late response. You can find tutorial for coap under: https://www.eclipsecon.org/france2014/sites/default/files/slides/Hands-on%20with%20CoAP.pdf.

Have fun and good luck

Best regards,
Son
Previous Topic:How to add extra options to CoAP request?
Next Topic:cannot capture coap packets using rawcap
Goto Forum:
  


Current Time: Sat Apr 20 04:13:36 GMT 2024

Powered by FUDForum. Page generated in 0.03322 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top