Page 1 of 1

Q: ESP8266 支持 HTTP 协议吗?如何实现?

Posted: Tue Jul 28, 2015 12:44 pm
by ESP_Luna
Q: ESP8266 支持 HTTP 协议吗?如何实现?
ESP8266 可以支持 HTTP 协议。
【non-OS SDK】
通过 espconn_sent(struct espconn *espconn, uint8 *psent, uint16 length) 实现
该函数中 espconn 为 TCP 通信的结构体,里面指定服务器的 IP 和 Port。
  • Psent:为发送数据的 Buffer 地址,用户需要将要发送的 Http 数据放到该psent 指向的 Buffer 中。
  • Length:要发送的数据的长度。
调用 socket 的 send 函数可以实现。
更多资料参考:Documentation > Sample Codes > ESP8266 as TCP client

Re: Q: Does the chip support HTTP posting? How do we do that?

Posted: Sun Aug 02, 2015 4:27 am
by kenn2
ESP8266 supports HTTP protocol.

POSTing data:

[Non-OS SDK]
Use espconn_sent (struct espconn * espconn, uint8 * psent, uint16 length) to POST data.

The structure espconn (TCP communications) specifies the server's IP and Port.

Psent: Buffer address of the http-encoded data to send

Length: Length of the data to be transmitted.

Users can do so by calling the send function of the socket.
For more information refer to: Documentation> Sample Codes> ESP8266 as TCP client.

(espressif - please correct where necessary)