chrysn / aiocoap

The Python CoAP library
Other
267 stars 120 forks source link

aiocoap-client update resource with body error #244

Open Ramzi04 opened 3 years ago

Ramzi04 commented 3 years ago

Python version: 3.8.10 (default, Jun 2 2021, 10:49:15) [GCC 9.4.0] aiocoap version: 0.4.1 Modules missing for subsystems: dtls: missing DTLSSocket oscore: everything there linkheader: everything there prettyprint: everything there Python platform: linux Default server transports: oscore:tcpserver:tcpclient:tlsserver:tlsclient:ws:udp6 Selected server transports: oscore:tcpserver:tcpclient:tlsserver:tlsclient:ws:udp6 Default client transports: oscore:tcpclient:tlsclient:ws:udp6 Selected client transports: oscore:tcpclient:tlsclient:ws:udp6 SO_REUSEPORT available (default, selected): True, True

Step-1 : I run this to register a temperature resource: aiocoap-client --method POST --content-format 40 --payload '</sensors/temp>;rt="temperature-c";secure=1' coap://localhost/resourcedirectory/?ep=node1 Step-2: I run this to update the previous resource: aiocoap-client --method POST --payload 'secure=0' coap://localhost/reg/1/ I got this error: 4.00 Bad Request Registration update with body not specified Why I got this error ?

chrysn commented 3 years ago

Because registration updates per POST have no payload as per registration update description.

There is currently no PATCH format specified for links (the section on further operations has some more details) -- you'll have to upload the whole link set again as you did in #243.

(By the way, what would that secure property indicate? During the specification of RD, no single example of the registered resources came up, so I'm curious...)

Ramzi04 commented 3 years ago

The secure property is already defined in https://github.com/chrysn/aiocoap/issues/231#issuecomment-817352139. It is a work in progress in my fork . I will do my best to make it more mature in the future.