CoAP Hello — UDP Reference
This server speaks CoAP over UDP only, so there is nothing here for a browser to call. Type a name and copy the command for the client you use — the page is static and works straight off disk.
Bundled client — cargo build --release first
Any other CoAP client, e.g. coap-cli
Set COAP_HOST / COAP_PORT to point at
another server; both default to 127.0.0.1:5683.
Routes
| Request | Code | Response |
|---|---|---|
| GET /hello | 2.05 | Hello, World! |
| GET /hello?name=… | 2.05 | Hello, …! |
| POST /hello | 2.01 | Hello, <payload>! |
| GET /health | 2.05 | {"status":"ok","uptime":12} |
| POST /hello (empty) | 4.00 | Bad Request |
| GET /nope | 4.04 | Not Found |
| PUT /hello | 4.05 | Method Not Allowed |
CoAP writes response codes as class.detail:
2.05 is HTTP's 200, 4.04 its 404.
POST /hello takes raw text or {"name":"…"}.
Scripts
Full request/response suite against a running server
./test-coap.sh
Liveness check — exit 0 healthy, 1 not
./healthcheck.sh -v
Start the server
cargo run --release