This "'require' is not recognized as an internal or external command, operable program or batch file." sounds like you are not executing the file with php.
There is an example on the guzzle github that shows how to call a GET request with params that should work.
// create a client $client = new GuzzleHttp\Client(); // set up and run the request $res = $client->request('GET', 'http://www.logicsms.co.za/postmsg2.aspx', [ 'query' => ['username' => 'user@org', 'password' => 'demo', 'mobile' => 12345678, 'message' => 'Test', 'Originator' => 'LogicSMSr'] ]); // assuming it returns a status code echo $res->getStatusCode();
Other response possibilities are in the docs, http://docs.guzzlephp.org/en/latest/quickstart.html#using-resp...
Thanks for your response, i did try examples and it said that it cannot find GuzzleHttp\Client. I suppose the require autoload should load it and it will be available but i do not know how to do it. This part:
After installing, you need to require Composer's autoloader: require 'vendor/autoload.php';
You dont have to require autoload from composer, laravel does it for you.
@terreporter pointed you the right code, but before you must add guzzle/guzzle to your project
You must edit composer.json on your project root folder.. Assuming you are confortable with manajing json.
Better if you go to console and run frlm project root: Composer require guzzle/guzzle Composer update
Then you are ready to use guzzle package
Thanks for all your help, in the end the only way I could make it work is by using it like this:
$client = new \GuzzleHttp\Client();
Ok thats simplify some things but when I run this script in my server i get a 500 error. I can only get through with github api site. Is it abnormal activity or I broke something?
Sign in to participate in this thread!
We'd like to thank these amazing companies for supporting us