概述
我有一个ESP8266,我正在编程在Arduino中。我需要做一个POST请求。我试过这段代码:ESP8266和POST请求
#include
#include
void setup() {
Serial.begin(115200); //Serial connection
WiFi.begin("ssid", "wifi_password"); //WiFi connection
while (WiFi.status() != WL_CONNECTED) { //Wait for the WiFI connection completion
delay(500);
Serial.println("Waiting for connection");
}
}
void loop() {
if(WiFi.status()== WL_CONNECTED){ //Check WiFi connection status
HTTPClient http; //Declare object of class HTTPClient
http.begin("server_name"); //Specify request destination
http.header("POST/HTTP/1.1");
http.header("Host: server_name");
http.header("Accept: */*");
http.header("Content-Type: application/x-www-form-urlencoded");
int htt
最后
以上就是凶狠项链为你收集整理的esp8266post请求html,ESP8266和POST请求的全部内容,希望文章能够帮你解决esp8266post请求html,ESP8266和POST请求所遇到的程序开发问题。
如果觉得靠谱客网站的内容还不错,欢迎将靠谱客网站推荐给程序员好友。
发表评论 取消回复