PHPackages                             brokeyourbike/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. brokeyourbike/php-http-client

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

brokeyourbike/php-http-client
=============================

HTTP REST client, simplified for PHP

3.10.0(6y ago)03MITPHPPHP &gt;=5.6

Since Mar 21Pushed 6y agoCompare

[ Source](https://github.com/brokeyourbike/php-http-client)[ Packagist](https://packagist.org/packages/brokeyourbike/php-http-client)[ Docs](http://github.com/sendgrid/php-http-client)[ RSS](/packages/brokeyourbike-php-http-client/feed)WikiDiscussions master Synced today

READMEChangelogDependencies (2)Versions (22)Used By (0)

[![Travis Badge](https://camo.githubusercontent.com/12f4b2e0fa45a59afe8afa3d23ee386cd8e89c1e94de7c311d641d7a6571edec/68747470733a2f2f7472617669732d63692e6f72672f62726f6b65796f757262696b652f7068702d687474702d636c69656e742e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/brokeyourbike/php-http-client)[![Latest Version on Packagist](https://camo.githubusercontent.com/2130dd2c69a3a1303a4e34450a5e07af93f942c57bfbecdae310a2f1fe551866/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f62726f6b65796f757262696b652f7068702d687474702d636c69656e742e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/brokeyourbike/php-http-client)[![GitHub contributors](https://camo.githubusercontent.com/71394daf8420a7da3b15d09a290169b74efbb8cb064e72a924b8e0c3e0fcec40/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f636f6e7472696275746f72732f62726f6b65796f757262696b652f7068702d687474702d636c69656e742e737667)](https://github.com/brokeyourbike/php-http-client/graphs/contributors)[![MIT licensed](https://camo.githubusercontent.com/7013272bd27ece47364536a221edb554cd69683b68a46fc0ee96881174c4214c/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d626c75652e737667)](./LICENSE)

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

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

[](#announcements)

All updates to this library is documented in our [CHANGELOG](https://github.com/brokeyourbike/php-http-client/blob/master/CHANGELOG.md).

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

[](#table-of-contents)

- [Installation](#installation)
- [Quick Start](#quick-start)
- [Usage](#usage)
- [Roadmap](#roadmap)
- [How to Contribute](#contribute)
- [License](#license)

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

[](#installation)

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

[](#prerequisites)

- PHP version 5.6 or higher

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": {
    "brokeyourbike/php-http-client": "~3.10.0"
  }
}
```

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

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

Then from the command line:

```
composer install
```

Quick Start
===========

[](#quick-start)

Here is a quick example:

`GET /your/api/{param}/call`

```
// include __DIR__ . '/loader.php';
require 'vendor/autoload.php';
$apiKey = YOUR_SENDGRID_API_KEY;
$authHeaders = [
    'Authorization: Bearer ' . $apiKey
];
$client = new BrokeYourBike\Client('https://api.sendgrid.com', $authHeaders);
$param = 'foo';
$response = $client->your()->api()->_($param)->call()->get();

var_dump(
    $response->statusCode(),
    $response->headers(),
    $response->body()
);
```

`POST /your/api/{param}/call` with headers, query parameters and a request body with versioning.

```
// include __DIR__ . '/loader.php';
require 'vendor/autoload.php';
$apiKey = YOUR_SENDGRID_API_KEY;
$authHeaders = [
    'Authorization: Bearer ' . $apiKey
];
$client = new BrokeYourBike\Client('https://api.sendgrid.com', $authHeaders);
$queryParams = [
    'hello' => 0, 'world' => 1
];
$requestHeaders = [
    'X-Test' => 'test'
];
$data = [
    'some' => 1, 'awesome' => 2, 'data' => 3
];
$param = 'bar';
$response = $client->your()->api()->_($param)->call()->post($data, $queryParams, $requestHeaders);

var_dump(
    $response->statusCode(),
    $response->headers(),
    $response->body()
);
```

If there is an issues with the request, such as misconfigured CURL SSL options, an `InvalidRequest` will be thrown with message from CURL on why the request failed. Use the message as a hit to troubleshooting steps of your environment.

Usage
=====

[](#usage)

- [Usage Examples](USAGE.md)

Roadmap
=======

[](#roadmap)

If you are interested in the future direction of this project, please take a look at our [milestones](https://github.com/brokeyourbike/php-http-client/milestones). We would love to hear your feedback.

How to Contribute
=================

[](#how-to-contribute)

We encourage contribution to our libraries, please see our [CONTRIBUTING](https://github.com/brokeyourbike/php-http-client/blob/master/CONTRIBUTING.md) guide for details.

Quick links:

- [Feature Request](https://github.com/brokeyourbike/php-http-client/blob/master/CONTRIBUTING.md#feature-request)
- [Bug Reports](https://github.com/brokeyourbike/php-http-client/blob/master/CONTRIBUTING.md#submit-a-bug-report)
- [Sign the CLA to Create a Pull Request](https://github.com/brokeyourbike/php-http-client/blob/master/CONTRIBUTING.md#cla)
- [Improvements to the Codebase](https://github.com/brokeyourbike/php-http-client/blob/master/CONTRIBUTING.md#improvements-to-the-codebase)
- [Review Pull Requests](https://github.com/brokeyourbike/php-http-client/blob/master/CONTRIBUTING.md#code-reviews)

Thanks
======

[](#thanks)

We were inspired by the work done on [birdy](https://github.com/inueni/birdy) and [universalclient](https://github.com/dgreisen/universalclient).

License
=======

[](#license)

[The MIT License (MIT)](LICENSE)

###  Health Score

29

—

LowBetter than 60% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity3

Limited adoption so far

Community19

Small or concentrated contributor base

Maturity67

Established project with proven stability

 Bus Factor1

Top contributor holds 58.5% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~68 days

Recently: every ~160 days

Total

21

Last Release

2342d ago

Major Versions

1.0.1 → 2.0.12016-05-11

2.0.2 → 3.0.02016-06-07

PHP version history (2 changes)1.0.0PHP &gt;=5.3

3.3.0PHP &gt;=5.6

### Community

Maintainers

![](https://www.gravatar.com/avatar/114f3c6e8506e0bba763451e8e4bcc3e94d662c2dce982a910b5d7b3444593cf?d=identicon)[brokeyourbike](/maintainers/brokeyourbike)

---

Top Contributors

[![thinkingserious](https://avatars.githubusercontent.com/u/146695?v=4)](https://github.com/thinkingserious "thinkingserious (113 commits)")[![misantron](https://avatars.githubusercontent.com/u/9839955?v=4)](https://github.com/misantron "misantron (17 commits)")[![mazanax](https://avatars.githubusercontent.com/u/2505148?v=4)](https://github.com/mazanax "mazanax (10 commits)")[![thepriefy](https://avatars.githubusercontent.com/u/10849586?v=4)](https://github.com/thepriefy "thepriefy (7 commits)")[![brokeyourbike](https://avatars.githubusercontent.com/u/1554371?v=4)](https://github.com/brokeyourbike "brokeyourbike (6 commits)")[![budirec](https://avatars.githubusercontent.com/u/11371076?v=4)](https://github.com/budirec "budirec (3 commits)")[![pushkyn](https://avatars.githubusercontent.com/u/3326427?v=4)](https://github.com/pushkyn "pushkyn (3 commits)")[![goteamtim](https://avatars.githubusercontent.com/u/1520573?v=4)](https://github.com/goteamtim "goteamtim (3 commits)")[![jmauerhan](https://avatars.githubusercontent.com/u/4204262?v=4)](https://github.com/jmauerhan "jmauerhan (3 commits)")[![jawnothin](https://avatars.githubusercontent.com/u/5176161?v=4)](https://github.com/jawnothin "jawnothin (2 commits)")[![Braunson](https://avatars.githubusercontent.com/u/577273?v=4)](https://github.com/Braunson "Braunson (2 commits)")[![Pawka](https://avatars.githubusercontent.com/u/2011?v=4)](https://github.com/Pawka "Pawka (2 commits)")[![pawel-lewtak](https://avatars.githubusercontent.com/u/5846223?v=4)](https://github.com/pawel-lewtak "pawel-lewtak (2 commits)")[![alextech](https://avatars.githubusercontent.com/u/3820828?v=4)](https://github.com/alextech "alextech (2 commits)")[![nvzard](https://avatars.githubusercontent.com/u/19310512?v=4)](https://github.com/nvzard "nvzard (2 commits)")[![ProZsolt](https://avatars.githubusercontent.com/u/4410174?v=4)](https://github.com/ProZsolt "ProZsolt (2 commits)")[![valerianpereira](https://avatars.githubusercontent.com/u/5975506?v=4)](https://github.com/valerianpereira "valerianpereira (1 commits)")[![alex2sat](https://avatars.githubusercontent.com/u/1806103?v=4)](https://github.com/alex2sat "alex2sat (1 commits)")[![ciceropablo](https://avatars.githubusercontent.com/u/174275?v=4)](https://github.com/ciceropablo "ciceropablo (1 commits)")[![dhsrocha](https://avatars.githubusercontent.com/u/3463383?v=4)](https://github.com/dhsrocha "dhsrocha (1 commits)")

---

Tags

http-clientphphttpapirestsendgridfluent

###  Code Quality

TestsPHPUnit

Code StylePHP\_CodeSniffer

### Embed Badge

![Health badge](/badges/brokeyourbike-php-http-client/health.svg)

```
[![Health](https://phpackages.com/badges/brokeyourbike-php-http-client/health.svg)](https://phpackages.com/packages/brokeyourbike-php-http-client)
```

###  Alternatives

[sendgrid/php-http-client

HTTP REST client, simplified for PHP

15344.3M4](/packages/sendgrid-php-http-client)[nategood/httpful

A Readable, Chainable, REST friendly, PHP HTTP Client

1.8k17.2M267](/packages/nategood-httpful)[bigcommerce/api

Enables PHP applications to communicate with the Bigcommerce API.

1501.1M8](/packages/bigcommerce-api)[quickbooks/payments-sdk

The Official PHP SDK for QuickBooks Online Payments API

2758.2k2](/packages/quickbooks-payments-sdk)[jsor/hal-client

A lightweight client for consuming and manipulating Hypertext Application Language (HAL) resources.

2425.9k1](/packages/jsor-hal-client)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
