PHPackages                             httptools/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. httptools/client

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

httptools/client
================

A simple PHP library for making HTTP requests using cURL

1.1.0(2y ago)4972MITPHP

Since Oct 19Pushed 2y ago1 watchersCompare

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

READMEChangelog (2)DependenciesVersions (3)Used By (0)

Client
======

[](#client)

Client is a PHP library that provides a simple and easy-to-use interface for making HTTP requests using cURL. It allows you to easily set HTTP headers, request body, request method, and other options.

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

[](#installation)

You can install Client using Composer:

```
composer require httptools/client

```

Usage
-----

[](#usage)

To use Client, you first need to create an instance of the class:

```
require_once 'vendor/autoload.php';

use httptools\Client;

$http = new Client();
```

### Setting Request Options

[](#setting-request-options)

Client provides several methods for setting request options:

```
$http->Url('https://example.com');
$http->Method('POST');
$http->Headers([
    'Content-Type: application/json',
    'Authorization: Bearer XXXXXXXXXXXXXXXXXXXXXXXXX'
]);
$http->Body('{"foo": "bar"}');
$http->Timeout(30);
echo $http->getBody();
```

### Sending the Request

[](#sending-the-request)

To send the request, simply call the `Send()` method:

```
$response = $http->Send();
```

The `Send()` method returns the response from the server as a string.

### Getting the HTTP Status Code

[](#getting-the-http-status-code)

You can get the HTTP status code of the response using the `getStatus()` method:

```
$status = $http->getStatus();
```

### Add 1 Option

[](#add-1-option)

Client add cURL options for the request. You can modify these defaults by calling the `Option()` method:

```
$http->Option(CURLOPT_RETURNTRANSFER, true);
```

### Chaining Methods

[](#chaining-methods)

Client allows you to chain methods to make the code more readable:

```
$response = $http->Url('https://example.com')
    ->Method('POST')
    ->Headers([
        'Content-Type: application/json',
        'Authorization: Bearer XXXXXXXXXXXXXXXXXXXXXXXXX'
    ])
    ->Body('{"foo": "bar"}')
    ->Timeout(30)
    ->Send();
```

Error Handling
--------------

[](#error-handling)

Client throws an exception if cURL encounters an error while executing the request. You should always catch these exceptions to handle errors properly:

```
try {
    $response = $http->Send();
} catch (Exception $e) {
    echo 'Error: ' . $e->getMessage();
}
```

License
-------

[](#license)

Client is licensed under the MIT License. See `LICENSE` for more information.

Developer
---------

[](#developer)

Client is developed by Hossein Pira.

- Email:
- Telegram: @h3dev

If you have any questions, comments, or feedback, please feel free to contact John via email or Telegram.

###  Health Score

24

—

LowBetter than 32% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity15

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity44

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% 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 ~0 days

Total

2

Last Release

940d ago

### Community

Maintainers

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

---

Top Contributors

[![httptools](https://avatars.githubusercontent.com/u/148354584?v=4)](https://github.com/httptools "httptools (3 commits)")

### Embed Badge

![Health badge](/badges/httptools-client/health.svg)

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

###  Alternatives

[friendsofsymfony/rest-bundle

This Bundle provides various tools to rapidly develop RESTful API's with Symfony

2.8k73.3M319](/packages/friendsofsymfony-rest-bundle)[php-http/discovery

Finds and installs PSR-7, PSR-17, PSR-18 and HTTPlug implementations

1.3k309.5M1.2k](/packages/php-http-discovery)[nyholm/psr7

A fast PHP7 implementation of PSR-7

1.3k235.4M2.4k](/packages/nyholm-psr7)[pusher/pusher-php-server

Library for interacting with the Pusher REST API

1.5k94.8M293](/packages/pusher-pusher-php-server)[spatie/crawler

Crawl all internal links found on a website

2.8k16.3M52](/packages/spatie-crawler)[react/http

Event-driven, streaming HTTP client and server implementation for ReactPHP

78126.4M414](/packages/react-http)

PHPackages © 2026

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