I have a question relating to sending a POST request from an iOS app to a web service written in php, that will ultimately query a MySQL database.
tldr: How do I view the contents of the POST variables directly in the browser window, without refreshing?
Long version:
I had written my Swift code in Xcode, with NSURLSession, request, data etc.
I had a php web page set to var_dump($_POST);
so that I could check that the data was sent in correctly (my data was a hard-coded string in Xcode for testing purposes).
I couldn't for the life of me figure out why I kept getting empty POST
variables, until I decided to add a test query statement to my web page binding the POST
variable. Lo and behold, the query ran successfully and my table updated.
I now realise that the reason I thought the POST
variable was empty was because I was refreshing the web page in order to see the results of my var_dump
. I now also know that this was deleting the POST
data, because when I repeated this action with the query statement, my table was getting NULL
rows.
My question is how do I view the contents of the POST
variables directly in the browser window, without refreshing? I know this must be a real noob goose chase I've led myself on... but I am a noob.
Thank you