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

Posts: 32
Joined: Wed Jun 17, 2015 4:10 pm

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

Postby ESP_Luna » Tue Jul 28, 2015 12:44 pm

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

Posts: 2
Joined: Sun Aug 02, 2015 3:46 am

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

Postby kenn2 » Sun Aug 02, 2015 4:27 am

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)

Who is online

Users browsing this forum: No registered users and 1 guest