Is there a way to send CoAP requests, like HTTP requests, using Python. I tried below one but I got many errors.
rec = reuest.get(coap://localhost:5683/other/block)
You can use a library such as CoAPython to act as a CoAP client:
from coapthon.client.helperclient import HelperClient
client = HelperClient(server=('127.0.0.1', 5683))
response = client.get('other/block')
client.stop()
The response
is of type Response
. The methods available on the response are listed in the documentation, which you must build yourself.
Since you haven't listed what you want to do with the response, you can use the documentation to find out the methods available and get the values you want.