我正在使用NodeMCU固件的HTTP模块使用以下代码。根据文档,HTTP和HTTPS URL都可以工作。如何在NodeMCU HTTP模块中使用HTTPS发布请求
https://nodemcu.readthedocs.io/en/master/en/modules/http/#httppost
当我使用的 'https' 虽然我得到错误。 'http'对我来说工作正常。对于代码中的URL,我面临以下错误。
“纯HTTP请求已发送到HTTPS端口”。
请帮忙。
http.post('https://maker.ifttt.com/trigger/......',
'Content-Type: application/json\r\n',
'{"value1":"mainlobby"}', function(code, data)
if (code < 0) then
print("HTTP request failed")
else
print(code, data)
end
end
谢谢。我错过了在固件中添加SSL支持。虽然看起来像在nodemcu 2.0.0 build中,即使在添加ssl支持之后,它也不起作用。虽然我得到了我的查询的答案。再次感谢。 http://stackoverflow.com/questions/42414431/nodemcu-lua-http-get-disconnected-with-error-8-what-is-error-8 – Jatinder