I used GuzzleHttp, I have created request following commands:
use GuzzleHttp\Client;
use GuzzleHttp\Psr7\Request;
$url = 'http://localhost/api/get_data?token=123456';
$client = new Client();
$request = $client->createRequest('GET', $url, []);
But error:
Argument 3 passed to GuzzleHttp\Client::request() must be of the type array, string given, called in /home/datnq/www/slim/vendor/guzzlehttp/guzzle/src/Client.php on line 88 and defined
Why did I miss ? I think parameters are right!
The reason why is that usage is for Guzzle 5.x, however, that message is most likely from using 6.x versions. I'd post a link to the 6.x version of the docs, but all I can find is http://guzzle.readthedocs.org/en/latest/quickstart.html and it isn't semantically versioned.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With