0
有人可以告诉我如何编写http.post()请求的主体以从ESP8266上连接的传感器读取值?NodeMCU HTTP模块HTTP.POST()请求正文参数
wifi.setmode(wifi.STATION);
wifi.sta.config("ssid","pwd")
local sensorPin = adc.read(0)
http.post('url',
'Content-Type: application/json\r\n',
'"humidity":sensorPin'
,function(code, data)
if (code < 0) then
print("HTTP request failed")
else
print(code, data)
end
end)
我怎样才能读取的GPIO引脚连接的传感器值,并把那个作为“钥匙”的价值:在POST请求的身体“值”对?
你需要更多的反馈吗? –