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

ActiveLibrary

walker/incutio-php-http-client
==============================

 HttpClient is a client class for the HTTP protocol.

1719816PHP

Since May 26Pushed 4y ago5 watchersCompare

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

READMEChangelogDependenciesVersions (1)Used By (0)

About
=====

[](#about)

This is a continuation of the Incutio PHP HTTP Client class. It's still one of the better standalone HTTP client classes out there. I'm just going to make it do more.

Of all I can find on the HTTP spec, body content is allowed with POST, PUT, and DELETE requests, so we allow you to send body content when using this client.

Instantiation
-------------

[](#instantiation)

```
$client = new HttpClient('www.domain.com', 80);

```

Where the first argument is the domain and the second is the port. The port is optional and default to 80 if not provided.

If you'd like to instantiate on an https:// URL, add it to the domain:

```
$client = new HttpClient('https://www.domain.com');

```

This will automatically use port 443 when connecting.

Basic Authentication
--------------------

[](#basic-authentication)

If the API you are accessing using this library requires basic authentication:

```
$client->setAuthorization('username', 'password');

```

GET
---

[](#get)

`$data` can be an object or array. `$headers` should be an array

```
$client->get('/service/endpoint', $data, $headers);

```

POST
----

[](#post)

`$data` can be a string, object, or array. `$headers` should be an array

```
$client->post('/service/endpoint', $data, $headers);

```

PUT
---

[](#put)

`$data` can be a string, object, or array. `$headers` should be an array

```
$client->put('/service/endpoint', $data, $headers);

```

DELETE
------

[](#delete)

`$data` can be a string, object, or array. `$headers` should be an array

```
$client->put('/service/endpoint', $data, $headers)

```

Headers
-------

[](#headers)

Content-Type on requests is no longer set by default.

If Accept is not set, it defaults to:

```
'text/xml,application/xml,application/xhtml+xml,text/html,text/plain,image/png,image/jpeg,image/gif,*/*'

```

Headers should be things like:

```
array('Accept'=>'application/json', 'Content-Type':'text/xml', 'etc')

```

`$data` and `$headers` are optional in all of these.

Referer
-------

[](#referer)

The Incutio library used to set the referer of a call as the last item called. I rarely find this helpful, so it's turned off by default now. To turn it back on:

```
$this->client->setPersistReferers(true);

```

Response Content
----------------

[](#response-content)

Get the content returned by the most recent URL call.

```
$client->getContent();

```

Response Headers
----------------

[](#response-headers)

You can get just the status or all the headers from your most recent URL call:

```
$client->getStatus();
$client->getHeaders();

```

###  Health Score

24

—

LowBetter than 32% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity23

Limited adoption so far

Community16

Small or concentrated contributor base

Maturity33

Early-stage or recently created project

 Bus Factor1

Top contributor holds 96.6% 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.

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/3987?v=4)[Walker](/maintainers/walker)[@walker](https://github.com/walker)

---

Top Contributors

[![walker](https://avatars.githubusercontent.com/u/3987?v=4)](https://github.com/walker "walker (28 commits)")[![rkgordon3](https://avatars.githubusercontent.com/u/538114?v=4)](https://github.com/rkgordon3 "rkgordon3 (1 commits)")

### Embed Badge

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

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

PHPackages © 2026

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