Part Number: MSP432E401Y
Tool/software: Code Composer Studio
I can build, load, and run the httpserver example on the MSP432E401Y launchpad.
I can run the httpSampler.py script to verify operation, but I think the tests verifying POST operations are incorrect. In the Python code the post entities are added to the "params" function parameter. This adds the post entities on to the URL, exactly like a GET operation. To really test POST functionality, it seems to me the post entities should be added to the Python request function "data" parameter so they are added to the body of the request.
Here is a link to the request method: https://requests.readthedocs.io/en/master/api/
Here is another link describing the differences between POST and GET: https://www.w3schools.com/tags/ref_httpmethods.asp
Now when the POST data is appended to the URL, that data is available in the URL for the httpserver demo function URLSimple_process in urlsimple.c. URLSimple_process handles the data from the URL and everything seems to work.
Unfortunately when data is posted from a web browser the POST data is put in the request body and that data never makes it into the URLSimple_process because httpserver.C does not process data in the body for POST requests.
Is there any alternate httpserver.C code that processes POST data in the request body? There is a note in the code:
/*
* Receive and process all the remaining fields in the
* request header, looking for the ones we care about.
*
* TODO: enable users to specify required fields and
* get the associated data, possibly via callbacks. Some
* of the fields should really go to the URLHandlers,
* like Content-Type.
*/
Until this is done, I do not think you should not claim to correctly handle POST requests.