-
Notifications
You must be signed in to change notification settings - Fork 407
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
How WRITE with /objectId/instanceId is implemented according to the spec 1.0.2? #1114
Comments
I understand like you and I hope this is what it is implemented in Leshan. |
Yes, if you can point me there, please! The question is how this is implemented and if Leshan is using only POST for WRITE methods with objectId and instanceId or instead it can be switched between POST and PUT depending on type (replace or update)? |
The API allow to choose the Mode when you create a WriteRequest. The code at server side is pretty simple : I guess if you ask this, you probably face an issue about this ? or ? |
Yes, thank you so much! The issue which we had was like this that we were wondering what is a behavior of Leshan library in such a scenario as we were pointed to a table in the spec where in this specific scenario we should expect always a POST method. But looks like you did it well guys, as it was designed by spec. Everything is fine for us. Thank you once again for your excellent support and such a quick responses! |
My pleasure. If this is not already done and if you think it make sense, maybe you could consider to add your company and/or customer as Leshan Adopters ? #830 |
I guess I can close the issue ? |
I close this one but feel free to reopen if needed 😉 |
Hi guys,
according to the spec: OMA-TS-LightweightM2M-V1_0_2-20180209-A
for write operation we may have 2 coap methods:
/{Object ID}/{Object Instance ID}/{Resource ID}
and
/{Object ID}/{Object Instance ID}
but terminology is a bit unclear as in the spec in chapter 8.2.5 it is also defined that:
"An Object Instance or Resource is written to by sending either a CoAP PUT request to the corresponding path. The request includes the value to be written in the corresponding Plain Text, Opaque,TLV or JSON format according to the Content-Format option which MUST be specified [CoAP]. In addition, an Object Instance can be written by sending a CoAP POST request; in that case the specified Content-Format MUST be the LwM2M TLV or LwM2M JSON. A CoAP PUT is used for the Replace and CoAP POST is used for Partial Update mechanism of the “Write” operation as described in 5.4.3. "
So our understanding and our customers is like this that both below cases can go with PUT or POST depending on wanted behaviour
and it all depends on the fact if this is a replacement or an update.
So my question is how it was implemented in Leshan under the hood?
The text was updated successfully, but these errors were encountered: