While tinkering with ESP8266/ESP32 projects and have ran aground and need some help from

While tinkering with ESP8266/ESP32 projects and have ran aground and need some help from the comunity.
I am trying to send a packet that consists on an array of 6 by n parameters from a mobile to an ESP8266/ESP32.
I have been looking at JSON but cannot make sense of it can anyone provide any tips or point me to some reading material.
I have managed to send sensor data to an SQL db via PHP from an ESP8266/ESP32 via POST but cannot make sense of sending data to the ESP8266/ESP32.
Thank you.

You would need to tell us for a start which Dev environment you are using
Arduino, Lua or Micropython? Then the right people might help. It’s also worthwhile to post up more info on what you have done.

Thanks for the quick reply Richard.
I am using App inventor on the mobile side and arduino env on the ESP side.

I have been thinking that I could do it with the html headers but my data size changes. Array can be 6 by 1, 6 by 2… 6 by n depending on user input and I thought that with html post you have to stick with a fixed structure.

As in you have to preallocate a buffer for them to go into? It depends on the framework. I don’t know the Arduino one - I use Lua for my ESP8266 stuff, but it normally gives you a web server and then callbacks for blocks of data. Further, you can have streaming JSON engines that will hook into that - Lua for example has SJON - so Arduino will have a similar library.

If you can do an AJAX post (Content-type: application/json) instead of a normal form post (which has to be form encoded, and this complicates things), then you can feed the data straight into that streaming json library and get a structure out of it that you can use. Again, I don’t know how Arduino does it, in Lua it just comes up as tables of tables.

Thanks Richard, can you point me to any literature/tutorials or implementation examples so that I can port them to arduino/App Inventor

Maybe this? https://www.youtube.com/watch?v=Edbxyl2BhyU

Will do. Thanks Richard.

Tonight I managed to get the server to acknowledge the client connection (might have a server parsing issue)… time to have a look at you video… thanks