- Fri Mar 25, 2016 1:59 pm
#44024
Got it!
Turns out making https requests needs some custom firmware. Turns out there is a great resource for making custom firmware.
http://nodemcu-build.com by selecting a dev build, I was able to add http with https support and successfully make my https post.
Code: Select allbody = '{"Team":1, "Item1":2, "Item2":3, "Item3":4}'
http.post('https://SOME_ENDPOINT_URL',
'Content-Type: application/json\r\n'
..'Authorization: Bearer SOME_CRAZY_AUTH_KEY\r\n'
..'Accept-Encoding: gzip, deflate\r\n',
body,
function(code, data)
if (code < 0) then
print("HTTP request failed")
else
print(code, data)
end
end)