01 Overview
HTTP client: request, status, body.
- Use when: REST, firmware check, simple posts.
- Skip when: you need a live push channel (MQTT).
Reach a server
Device-side GET/POST. Fits REST backends.
Official path: examples/protocols/esp_http_client
HTTP client: request, status, body.
1. Create the client after GOT_IP.
2. Set URL, method, headers.
3. Read the body. Split DNS, TLS and HTTP errors.
4. Public internet should be HTTPS with a maintained cert store.
中文
连上服务器
设备主动 GET/POST。对接 REST 云或自己的后台。
官方路径: examples/protocols/esp_http_client
演示 HTTP 客户端:请求、状态码、响应体。
1. GOT_IP 之后创建 client。
2. 配置 URL、方法、头。
3. 读响应。错误要区分 DNS、TLS、4xx/5xx。
4. 公网应走 HTTPS,证书集要按平台维护。