-
• #2
All I can think is you need a
Content-Length
header? It's worth checking out https://www.espruino.com/IoT+Services for some HTTP post examples. -
• #3
That Fixed it!
-
• #4
How you fix this? I have the same problem with you
-
• #5
Hi there! I'm trying to get an example on how to make a post to io.adafruit.com from espruino with a NodeMCU and I couldn't find any example. Is there a way to pass the authentication headers?
-
• #6
@user87799 headers won't be a problem, I don't think, but ESP8266 on the NodeMCU is not capable of HTTPS communication via Espruino, so unless Adafruit offer the
http://
schema on their API you'll need use a Pico or Espruino Wifi (or maybe ESP32 - I'm not too familiar).
I am trying execute a post request from the device, but the device always returns a 'no connection' error when trying to POST.
To troubleshoot I have ran a GET request to the same URL, and the request was successful, this means that internet is working on the device and communication with the intended server is possible.
I then moved on to see if there were errors in my HTTP POST code, I ran the same code in a node.js app and it successfully posted to the server.
Here is the code below, I removed the exact address of my server and my wifi/pass info. I feel as though something is still wrong with the request code.
terminal response from device after execution
I know my ESPRUINO device can connect to the wifi because a) I am programming over TCP/IP and the GET requests to the server are successful.
Here is the documentation for Espruino.js HTTP module. https://www.espruino.com/Reference#http
Can any of the JS gurus see an issue with the request?
Sidenote: I have already configured my wifi with wifi.connect(); and wifi.save();