Hi, I am at a loss as to why I am unable to POST successfully to my Dream Factory instance. I am able to send a curl from command-line successfully and receive the correct response, but when I format the data as a regular HTTP POST request and try to POST from my microcontroller C code, I get a 503 error. It looks like the error is from the ClusterService.php file. Any thoughts?
Here’s my successful curl (with authorization information redacted):
curl -X POST "https://<redacted>.dreamfactory.com/api/v2/testdb/_table/Measurements" -H "Content-Type: application/json" -H "accept: application/json" -H "X-DreamFactory-API-Key: <redacted>" -d "{\"resource\":[{\"userID\":1,\"weight\":1,\"timestamp\":\"2018-02-17 21:05:13.5096722\",\"productID\":2,\"created_date\":\"2018-02-07 21:05:13.5096722\",\"last_updated_date\":\"2018-02-07 21:05:13.5096722\"}]}"
Curl successful response:
{"resource":[{"measurementID":21}]}
And here’s my unsuccessful HTTP POST request as used in my esp32 microcontroller code:
POST https://<redacted>.dreamfactory.com/api/v2/testdb/_table/Measurements HTTP/1.0
Accept: application/json
Connection: keep-alive
Content-Type: application/json
X-DreamFactory-API-Key: <redacted>
{"resource":[{"userID":1,"weight":32,"timestamp":"2018-01-02 00:00:00.00","productID":2,"created_date":"2018-01-01 00:00:00.00","last_updated_date":"2018-01-01 00:00:00.00"}]}
MCU error response:
HTTP/1.1 200 OK
Server: nginx
Content-Type: text/html; charset=UTF-8
Connection: close
Cache-Control: no-cache, private
Date: Wed, 28 Feb 2018 18:28:55 GMT
x-dreamfactory-routed: true
{"error":{"code":503,"message":"Error interrogating console: Corrupt response during status query for \"\"."}}
I did a google search for “Error interrogating console” and I was directed to this GitHub repository. Any guidance would be very much appreciated!