Skip to content

Latest commit

 

History

History
26 lines (24 loc) · 742 Bytes

how-to-install-php-guzzle-with-composer.md

File metadata and controls

26 lines (24 loc) · 742 Bytes

How to install PHP Guzzle with Composer?

// plain

  1. Install Composer on your system.
  2. Create a composer.json file in the root of your project and add the following code:
{
    "require": {
        "guzzlehttp/guzzle": "^6.3"
    }
}
  1. Run composer install in the root of your project.
  2. Include the autoloader in your project:
require 'vendor/autoload.php';
  1. Use Guzzle in your project:
$client = new \GuzzleHttp\Client();
$response = $client->request('GET', 'https://example.com');
echo $response->getStatusCode(); // 200

onelinerhub: How to install PHP Guzzle with Composer?