PHPackages                             sendgrid/php-http-client - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [HTTP &amp; Networking](/categories/http)
4. /
5. sendgrid/php-http-client

ActiveLibrary[HTTP &amp; Networking](/categories/http)

sendgrid/php-http-client
========================

HTTP REST client, simplified for PHP

4.1.3(1y ago)15344.3M—4.6%69[9 PRs](https://github.com/sendgrid/php-http-client/pulls)4MITPHPPHP &gt;=7.3CI passing

Since Mar 21Pushed 1y ago151 watchersCompare

[ Source](https://github.com/sendgrid/php-http-client)[ Packagist](https://packagist.org/packages/sendgrid/php-http-client)[ Docs](http://github.com/sendgrid/php-http-client)[ RSS](/packages/sendgrid-php-http-client/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (10)Dependencies (3)Versions (46)Used By (4)

[![SendGrid Logo](twilio_sendgrid_logo.png)](twilio_sendgrid_logo.png)

[![Tests](https://github.com/sendgrid/php-http-client/actions/workflows/test-and-deploy.yml/badge.svg)](https://github.com/sendgrid/php-http-client/actions/workflows/test-and-deploy.yml)[![Latest Version on Packagist](https://camo.githubusercontent.com/99ba58dd265f9d13b4ceda23bd893a7e9dc873474b798700c7c1d1b5706fa765/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f73656e64677269642f7068702d687474702d636c69656e742e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/sendgrid/php-http-client)[![Twitter Follow](https://camo.githubusercontent.com/de94c561669f318291c017e2043b37498ea2f8820d5f35be0af56fe149c1a793/68747470733a2f2f696d672e736869656c64732e696f2f747769747465722f666f6c6c6f772f73656e64677269642e7376673f7374796c653d736f6369616c266c6162656c3d466f6c6c6f77)](https://twitter.com/sendgrid)[![GitHub contributors](https://camo.githubusercontent.com/fe117bc8d8e434b1b8427b2963baba82682d93412a3842b380cf4c41b1d6dae5/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f636f6e7472696275746f72732f73656e64677269642f7068702d687474702d636c69656e742e737667)](https://github.com/sendgrid/php-http-client/graphs/contributors)[![MIT licensed](https://camo.githubusercontent.com/7013272bd27ece47364536a221edb554cd69683b68a46fc0ee96881174c4214c/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d626c75652e737667)](LICENSE)

**Quickly and easily access any RESTful or RESTful-like API.**

If you are looking for the SendGrid API client library, please see [this repo](https://github.com/sendgrid/sendgrid-php).

Announcements
=============

[](#announcements)

All updates to this library are documented in our [CHANGELOG](CHANGELOG.md).

Table of Contents
=================

[](#table-of-contents)

- [Installation](#installation)
- [Quick Start](#quick-start)
- [Usage](#usage)
- [How to Contribute](#contribute)
- [Thanks](#thanks)
- [About](#about)
- [Support](#support)
- [License](#license)

Installation
============

[](#installation)

Prerequisites
-------------

[](#prerequisites)

- PHP version 7.3+

Install with Composer
---------------------

[](#install-with-composer)

Add php-http-client to your `composer.json` file. If you are not using [Composer](http://getcomposer.org), you should be. It's an excellent way to manage dependencies in your PHP application.

```
{
  "require": {
    "sendgrid/php-http-client": "^4.1.3"
  }
}
```

Then at the top of your PHP script require the autoloader:

```
require __DIR__ . '/vendor/autoload.php';
```

Then from the command line:

```
composer install
```

Install without Composer
------------------------

[](#install-without-composer)

You should create a `lib` directory in the directory of your application and clone to `lib` repositories [php-http-client](https://github.com/sendgrid/php-http-client.git) and [sendgrid-php](https://github.com/sendgrid/sendgrid-php.git):

```
$ cd /path/to/your/app
$ mkdir lib
$ cd lib
$ git clone https://github.com/sendgrid/php-http-client.git

```

In the next step you should create `loader.php`:

```
$ cd /path/to/your/app
$ touch loader.php

```

And add the code below to the `loader.php`:

```
