I'm trying to run an application with coap but I'm new. I am using the python coapthon3 library. But I want to get the payloads from the library using the encoding path. But I could not do this. My client code is as follows. Thank you
from coapthon.client.helperclient import HelperClient
host = "127.0.0.1"
port = 5683
path = "encoding"
payload = 'text/plain'
client = HelperClient(server=(host, port))
response = client.get(path + 'application/xml' + '<value>"+str(payload)+"</value>')
client.stop()
No, you shouldn't concatenate all the stuff to the path.
Unfortunately HelperClient#get does not provide an ability to specify a payload though it is pretty legal according to CoAP spec.
So you need to create a request and fill all the needed fields, and to use send_request method.
I guess my snippet is not that pythonish so please bear with me.