ESP32 http post example
Posted: Mon Nov 26, 2018 1:29 pm
Hi, I am currently using http GET request in my aplication to send data to my MySQL database via PHP script.
I have one PHP script for every function I need like insert, delete, update and for individual tables.
It is a lot of PHP scripts.
Now I intend to port the whole thing to use a single PHP script that receives the SQL preformated command that is already in use by an Android app to read the same tables from the same database.
The problem is that this PHP script has been designed to receive data via POSTs and not GETs and I do not want to change the original design so the solution is to modify my ESP32 code to send POSTs instead of GETs.
The piece of PHP script that first receives the data is as follow:
The variables QUERY and KEY are again used latter in the application.
I am looking for examples I can use as base to make this move.
Thanks in advance
Paulo Borges
I have one PHP script for every function I need like insert, delete, update and for individual tables.
It is a lot of PHP scripts.
Now I intend to port the whole thing to use a single PHP script that receives the SQL preformated command that is already in use by an Android app to read the same tables from the same database.
The problem is that this PHP script has been designed to receive data via POSTs and not GETs and I do not want to change the original design so the solution is to modify my ESP32 code to send POSTs instead of GETs.
The piece of PHP script that first receives the data is as follow:
Code: Select all
if( isset($_POST['query']) && isset($_POST['key']) ){...
I am looking for examples I can use as base to make this move.
Thanks in advance
Paulo Borges