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.
Espruino is a JavaScript interpreter for low-power Microcontrollers. This site is both a support community for Espruino and a place to share what you are working on.
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();