I am working with an api from a gateway that I want to send a series of replies to a POST request from the other end.
It sends notification that ideas are in the remote queue but this script must respond by going and getting the queue data (rather than it coming in the POST)
- So the PHP script receives the POST, it then does some user data lookups and checks locally.
- Then return a header status 200 to the POST request with empty body.
- Then construct a following GET request to get the rest of the data.
- Process the queue data for payment
- Return 404 termination at any point the process fails.
How can I send in essence multiple output "messages" back from a single php script, while not terminating it?
First a header status 200 with empty body and the I can still do the get request.
Or am I thinking of this the wrong way. I wanted to do it all GET and POST in Gulp and change the script that I was given but I can't see how to send a response while I know how to receive with it.
Thanks.