I am trying to use Guzzle instead of using cURL directly to achieve and HTTP request. How to make the same type of request, but using Guzzle? Or should I just stick with cURL?
$ch = curl_init();
This is how I got it. I continue to work with error 401 Unauthorized. I know that I have the correct credentials. What makes me think that I'm not on the right track is the Guzzle: auth docs currently only supported using the cURL handler, but a replacement is planned that can be used with any HTTP handler. But from my understanding Guzzle uses cURL by default.
$guzzleData = [ 'auth' => [$token, 'X'], 'allow_redirects' => true, 'verify' => false, ]; $client = new \Guzzle\Http\Client(); $request = $client->get($url, $guzzleData); $response = $request->send();
source share