I'm using Guzzle for http post requests, but I'm having problems with it redirecting after the code runs
use GuzzleHttp\Client;
$billclient = new Client();
$request = $billclient->post('http://posturl.com', [
'body' => 'lorem ipsum'
]);
$redirect = new Client();
$redirect->get('http://google.com');
header("Location: http://google.com");
If I am running multiple Guzzle requests it doesn't seem to want to load, and instead the script ends. I really need to redirect to another page because it passes a query string that fills in the forms on the next page (second call to action)
EDIT: It seems like Guzzle closes off all handles as soon as a new Client is initiated. The code works fine if I remove the New Client() portion of the code. I've gone back to using CURL requests for now, but this isn't a very good long term solution since it makes the code very fragile.
Any ideas?