Can anyone help how to differentiate the incoming message structure of PUT and POST methods in CoAP protocol?
Or should we do some work in server c++ files ???
Can anyone help how to differentiate the incoming message structure of PUT and POST methods in CoAP protocol?
Or should we do some work in server c++ files ???
Each CoAP message has a method code. It is 8 bit unsigned integer represented as x.yy
where x
is the 3 bit class and yy
is 5 bit detail field.
You can use it to differentiate between PUT and POST.
Check out the RFC for the message format and the method code list.
For POST the code is 0.02 i.e. the byte is encoded as 0x02
while for PUT it is 0.03 so the byte is encoded as 0x03
.