FONA808 using Adafruit_FONA: HTTP POST parameters

Adafruit Ethernet, Motor, Proto, Wave, Datalogger, GPS Shields - etc!

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
pk0312
 
Posts: 5
Joined: Tue Sep 25, 2018 6:22 am

FONA808 using Adafruit_FONA: HTTP POST parameters

Post by pk0312 »

I used the default sketch example from FONA lib on Github (https://github.com/adafruit/Adafruit_FO ... t.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_FO ... .cpp#L1632).

It works like this:

Code: Select all

        
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?

Locked
Please be positive and constructive with your questions and comments.

Return to “Arduino Shields from Adafruit”