The Guzzle HTTP client provides an API around the cURL and PHP’s stream wrapper allowing you to quickly make outgoing HTTP requests to communicate with other web applications.
Before getting started, you should ensure that you have installed the Guzzle package as a dependency of your application.
You may install it via Composer:
composer require guzzlehttp/guzzle
use GuzzleHttp\Client; $client = new Client([ // Base URI is used with relative requests 'base_uri' => 'https://httpbin.org/', 'timeout' => 10, ]); // Send a request to https://httpbin.org/anything $response = $client->request('GET', 'anything');
- Guzzle Documentation
- Slim 4 - Guzzle (eBook Vol. 2)
- Slim 4 - Stripe (eBook Vol. 2)