I use the Guzzle\Http
library to be able to make requests to some urls with PHP.
I'm doing webservice with our systems, where, if the request is recognized as Ajax
, the returned result is Json
. Otherwise, HTML
is returned.
However, I now need to make requests in those urls with Guzzle
, and I want the request to be made by Guzzle
, so I'm also returned in Json
.
How to make requests with the Guzzle\Http
library, as if it were AJAX executed by a browser?
Do I need to put some or some headers to work?