PHPackages                             tmpbin/http - 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. tmpbin/http

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

tmpbin/http
===========

An http library developed for the laravel framework. aliases itself as HttpClient

v1.5.4(8y ago)010MITPHPPHP &gt;=5.6.4

Since May 30Pushed 8y ago1 watchersCompare

[ Source](https://github.com/tmpbin/http)[ Packagist](https://packagist.org/packages/tmpbin/http)[ RSS](/packages/tmpbin-http/feed)WikiDiscussions master Synced 2d ago

READMEChangelog (1)Dependencies (4)Versions (23)Used By (0)

[![build status](https://camo.githubusercontent.com/22d97d0c48ed70a18d473f559d3340f4e23a5783debae29e61a538ea2d69c50d/68747470733a2f2f7472617669732d63692e6f72672f56696e656c61622f687474702e706e673f6272616e63683d6d6173746572 "build status")](https://camo.githubusercontent.com/22d97d0c48ed70a18d473f559d3340f4e23a5783debae29e61a538ea2d69c50d/68747470733a2f2f7472617669732d63692e6f72672f56696e656c61622f687474702e706e673f6272616e63683d6d6173746572)

[![Dependency Status](https://camo.githubusercontent.com/d96e6edbc96b98f5bac72b2955b110f32db5342986d37f89bde41c252f54d2b5/68747470733a2f2f7777772e76657273696f6e6579652e636f6d2f757365722f70726f6a656374732f3533656663396136313362623036636336663030303462302f62616467652e7376673f7374796c653d666c6174)](https://www.versioneye.com/user/projects/53efc9a613bb06cc6f0004b0)

[![SensioLabsInsight](https://camo.githubusercontent.com/a9f82ef30973de8ea8e299e7e1a489e178469c7e40d0d7b1ad5702078d2ad549/68747470733a2f2f696e73696768742e73656e73696f6c6162732e636f6d2f70726f6a656374732f30363633313336612d366464652d343135392d626339362d6431373439353939646361342f6269672e706e67)](https://insight.sensiolabs.com/projects/0663136a-6dde-4159-bc96-d1749599dca4)

===============

[](#httpclient)

A smart, simple and fault-tolerant HTTP client for sending and recieving JSON and XML.

Installation
------------

[](#installation)

### Composer

[](#composer)

`composer require vinelab/http`

```
// change this to point correctly according
// to your folder structure.
require './vendor/autoload.php';

use Vinelab\Http\Client as HttpClient;

$client = new HttpClient;

$response = $client->get('echo.jsontest.com/key/value/something/here');

var_dump($response->json());
```

### Laravel

[](#laravel)

Edit **app.php** and add `'Vinelab\Http\HttpServiceProvider',` to the `'providers'` array.

It will automatically alias itself as **HttpClient** so no need to alias it in your **app.php**, unless you would like to customize it - in that case edit your **'aliases'** in **app.php** adding ` 'MyHttp'	  => 'Vinelab\Http\Facades\Client',`

Usage
-----

[](#usage)

### GET

[](#get)

#### Simple

[](#simple)

```
$response = HttpClient::get('http://example.org');

// raw content
$response->content();
```

#### With Params

[](#with-params)

```
$request = [
	'url' => 'http://somehost.net/something',
	'params' => [

		'id'     => '12350ME1D',
		'lang'   => 'en-us',
		'format' => 'rss_200'
	]
];

$response = HttpClient::get($request);

// raw content
$response->content();

// in case of json
$response->json();

// XML
$response->xml();
```

### POST

[](#post)

```
$request = [
	'url' => 'http://somehost.net/somewhere',
	'params' => [

		'id'     => '12350ME1D',
		'lang'   => 'en-us',
		'format' => 'rss_200'
	]
];

$response = HttpClient::post($request);

// raw content
$response->content();

// in case of json
$response->json();

// XML
$response->xml();
```

### Options

[](#options)

These options work with all requests.

#### Timeout

[](#timeout)

You can set the `timeout` option in order to specify the number of seconds that your request will fail, if not completed.

```
$request = [
	'url' => 'http://somehost.net/somewhere',
	'params' => [

		'id'     => '12350ME1D',
		'lang'   => 'en-us',
		'format' => 'rss_200'
	],
	'timeout' => 10
];
```

### Headers

[](#headers)

```
$response = HttpClient::get([
	'url' => 'http://somehost.net/somewhere',
	'headers' => ['Connection: close', 'Authorization: some-secret-here']
]);

// The full headers payload
$response->headers();
```

### Basic Auth

[](#basic-auth)

```
$response = HttpClient::get([
	'url' => 'http://somehost.net/somewhere',
	'auth' => [
		'username' => 'user',
		'password' => 'pass'
	],
	'params' => [
		'var1'     => 'value1',
		'var2'   => 'value2'
	]
]);
```

### Digest Auth

[](#digest-auth)

```
$response = HttpClient::get([
	'url' => 'http://some.where.url',
	'digest' => [
		'username' => 'user',
		'password' => 'pass'
	],
	'params' => [
		'var1'     => 'value1',
		'var2'   => 'value2'
	]
]);
```

### Enforce HTTP Version

[](#enforce-http-version)

```
HttpClient::get(['version' => 1.1, 'url' => 'http://some.url']);
```

### Raw Content

[](#raw-content)

```
HttpClient::post(['url' => 'http://to.send.to', 'content' => 'Whatever content here may go!']);
```

#### Custom Query String

[](#custom-query-string)

The content passed in the `content` key will be concatenated to the *URL* followed by a *?*

```
HttpClient::get(['url' => 'http://my.url', 'content' => 'a=b&c=d']);
```

> It is pretty much the same process with different HTTP Verbs. Supports `GET, POST, PUT, DELETE, PATCH, OPTIONS, HEAD`

Fault Tolerance
---------------

[](#fault-tolerance)

Fault tolerance allows the request to be re-issued when it fails (i.e. timeout). This is useful in cases such as Microservices: When a service is down and is being called by another service, with fault tolerance the request will be re-issued in the hopes of the destination service being up again.

Issue a fault-tolerant request by setting the `tolerant` flag to `true` in the request. Also, specify the time it should wait until it tries again with `timeUntilNextTry` (in seconds) and the number of tries before it is considered a failure with `triesUntilFailure` (in seconds).

```
$request = [
	'url' => 'http://somehost.net/somewhere',
	'params' => [

		'id'     => '12350ME1D',
		'lang'   => 'en-us',
		'format' => 'rss_200'
	],
	'timeout' => 10
	'tolerant' => true,
	'timeUntilNextTry' => 1,
	'triesUntilFailure' => 3
];
```

In case of timeout occurance, a `HttpClientRequestFailedException` will be thrown.

> **IMPORTANT! Notice**: In order to make use of fault tolerance option, you must specify the `timeout` parameter too.

###  Health Score

29

—

LowBetter than 59% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity5

Limited adoption so far

Community16

Small or concentrated contributor base

Maturity68

Established project with proven stability

 Bus Factor1

Top contributor holds 67.4% 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 ~70 days

Recently: every ~52 days

Total

22

Last Release

3249d ago

Major Versions

v0.1.10 → v1.0.02014-08-19

PHP version history (4 changes)v0.1.0PHP &gt;=5.3.0

v0.1.2PHP &gt;=5.4.0

v1.1.0PHP &gt;=5.4

v1.3.0PHP &gt;=5.6.4

### Community

Maintainers

![](https://www.gravatar.com/avatar/f3cb255bc3814a2a05cb6858b9a686b9c90f05e183d25fc06ce31bdc89cf61ae?d=identicon)[tmpbin](/maintainers/tmpbin)

---

Top Contributors

[![Mulkave](https://avatars.githubusercontent.com/u/2647333?v=4)](https://github.com/Mulkave "Mulkave (62 commits)")[![harris21](https://avatars.githubusercontent.com/u/1542015?v=4)](https://github.com/harris21 "harris21 (14 commits)")[![alisissa](https://avatars.githubusercontent.com/u/443781?v=4)](https://github.com/alisissa "alisissa (4 commits)")[![adibhanna](https://avatars.githubusercontent.com/u/1659384?v=4)](https://github.com/adibhanna "adibhanna (3 commits)")[![tmpbin](https://avatars.githubusercontent.com/u/5728594?v=4)](https://github.com/tmpbin "tmpbin (2 commits)")[![ybr-nx](https://avatars.githubusercontent.com/u/832778?v=4)](https://github.com/ybr-nx "ybr-nx (2 commits)")[![Znarkus](https://avatars.githubusercontent.com/u/168042?v=4)](https://github.com/Znarkus "Znarkus (1 commits)")[![dominikzogg](https://avatars.githubusercontent.com/u/1011217?v=4)](https://github.com/dominikzogg "dominikzogg (1 commits)")[![gjreasoner](https://avatars.githubusercontent.com/u/3363867?v=4)](https://github.com/gjreasoner "gjreasoner (1 commits)")[![messi89](https://avatars.githubusercontent.com/u/5730258?v=4)](https://github.com/messi89 "messi89 (1 commits)")[![nickma42](https://avatars.githubusercontent.com/u/4164665?v=4)](https://github.com/nickma42 "nickma42 (1 commits)")

---

Tags

httpjsonapiclientlaravelxmlcurl

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/tmpbin-http/health.svg)

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

###  Alternatives

[vinelab/http

An http library developed for the laravel framework. aliases itself as HttpClient

59300.2k11](/packages/vinelab-http)[php-curl-class/php-curl-class

PHP Curl Class makes it easy to send HTTP requests and integrate with web APIs.

3.3k9.5M353](/packages/php-curl-class-php-curl-class)[tcdent/php-restclient

A generic REST API client for PHP

3542.9M29](/packages/tcdent-php-restclient)[aplus/http-client

Aplus Framework HTTP Client Library

2161.6M1](/packages/aplus-http-client)[serpapi/google-search-results-php

Get Google, Bing, Baidu, Ebay, Yahoo, Yandex, Home depot, Naver, Apple, Duckduckgo, Youtube search results via SerpApi.com

69114.3k](/packages/serpapi-google-search-results-php)[rap2hpoutre/jacky

Opinionated REST JSON HTTP API client for laravel

174.4k](/packages/rap2hpoutre-jacky)

PHPackages © 2026

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