Skip to main content


CoAP client to test golioth coap gateway

coap [flags]


# Send a GET request to /hello
coap --path /hello -m GET --psk-id deadbeef-id --psk supersecret --host

# Send a POST request to /echo
# With body as string (-b)
coap --path /echo -m POST --psk-id deadbeef-id --psk supersecret --host -b "Hello"
# With body from file (-f)
coap --path /echo -m POST --psk-id deadbeef-id --psk supersecret --host -f ./test.txt

# Send a POST request to /logs
coap --path /logs -m POST --psk-id deadbeef-id --psk supersecret -q module=wifi -q msg="Signal from router" -q level=info -b "{ \"wifi-rssi\": -45 }" --format json --host


      --accept string          coap accept format
-b, --body string coap body
-f, --file string file to be sent on the request body
--format string coap body format
-h, --help help for coap
--host string golioth coap host (default "localhost")
--in read request body from stdin
-m, --method string coap method - GET,POST (default "GET")
-o, --observe stringArray coap observation paths
--out string file to save response body
-p, --path string coap url path (default "/echo")
--port int golioth coap port (default 5684)
--psk string coap pre shared key
--psk-id string coap psk identity
-q, --query stringToString coap query params (default [])
--timeout uint coap request timeout in seconds (default 5)
-w, --wait wait for replies