37 lines
596 B
Markdown
37 lines
596 B
Markdown
# HTTP API Validation
|
|
|
|
## Status
|
|
|
|
curl -s http://ESP32_IP/status | jq
|
|
|
|
## Relay On
|
|
|
|
curl -X POST http://ESP32_IP/relay/set \
|
|
-H "Content-Type: application/json" \
|
|
-d '{"id":"relay_1","state":true}'
|
|
|
|
## Relay Off
|
|
|
|
curl -X POST http://ESP32_IP/relay/set \
|
|
-H "Content-Type: application/json" \
|
|
-d '{"id":"relay_1","state":false}'
|
|
|
|
## Scan Temps
|
|
|
|
curl -X POST http://ESP32_IP/temps/scan
|
|
|
|
## WiFi Config
|
|
|
|
curl -X POST http://ESP32_IP/config/wifi \
|
|
-H "Content-Type: application/json" \
|
|
-d '{
|
|
"networks":[
|
|
{
|
|
"ssid":"Starlink",
|
|
"password":"PASSWORD",
|
|
"priority":1
|
|
}
|
|
]
|
|
}'
|
|
|