0

FONA808 using Adafruit_FONA: HTTP POST parameters
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

FONA808 using Adafruit_FONA: HTTP POST parameters

by pk0312 on Wed Oct 10, 2018 8:58 am

I used the default sketch example from FONA lib on Github (https://github.com/adafruit/Adafruit_FONA/blob/master/examples/FONAtest/FONAtest.ino#L754) and tried sending some parameters to my web server. On server the PHP script is exectued, but I don't get any $_POST or $_GET params!

The example uses HTTP_POST_start (https://github.com/adafruit/Adafruit_FONA/blob/master/Adafruit_FONA.cpp#L1632).

It works like this:

Code: Select all | TOGGLE FULL SIZE
       
uint16_t statuscode;
int16_t length;
char url[] = "http://www.myserver.com/script.php";
char data[] = "{\"simple\":\"json\"}";

fona.HTTP_POST_start(url, F("text/plain"), (uint8_t *) data, strlen(data), &statuscode, (uint16_t *)&length); // also tried "application/json" with no success



but as stated I don't see the json params or I don't know how to access these arguments in my PHP script. What is wrong?

pk0312
 
Posts: 5
Joined: Tue Sep 25, 2018 6:22 am

Please be positive and constructive with your questions and comments.