I am integrating another companies services with ours and they want to send an xml post request to us and get an 200 response with xml, but then I also need to forward the request.
Their user gets sent to our site when they click on a link on their page, which sends an xml post request to us. We are supposed to send an xml response back, and then forward the user to our home page.
I have figured out one or the other, but not both by setting headers.
For the 200 response:
header("Content-type: text/xml");
header("HTTP/1.1 200 OK");
header("Status: 200");
echo 'my-xml';
exit;
For the forward:
header("Location: http://www.example.com/");
exit;
But I can't figure out how to do both?
Also, this is being done in Wordpress by intercepting the pre_get_posts filter, which works fine.