PHPackages                             navinchinnasamy/custom-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. navinchinnasamy/custom-http-client

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

navinchinnasamy/custom-http-client
==================================

A simple Custom HTTP client package for Laravel applications.

11PHP

Since Oct 21Pushed 1y ago1 watchersCompare

[ Source](https://github.com/Navinchinnasamy/CustomHTTPClient)[ Packagist](https://packagist.org/packages/navinchinnasamy/custom-http-client)[ RSS](/packages/navinchinnasamy-custom-http-client/feed)WikiDiscussions main Synced today

READMEChangelogDependenciesVersions (2)Used By (0)

Custom HTTP Client
==================

[](#custom-http-client)

A flexible HTTP client manager in PHP that allows you to choose between different HTTP clients, such as Guzzle and PHP Streams, based on your requirements.

Table of Contents
-----------------

[](#table-of-contents)

- [Installation](#installation)
- [Usage](#usage)
- [Supported HTTP Clients](#supported-http-clients)
- [Examples](#examples)
- [License](#license)

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

[](#installation)

You can install this package using Composer. Run the following command in your terminal:

```
composer require navin/custom-http-client
```

Usage
-----

[](#usage)

To use the Custom HTTP Client, you need to create an instance of the desired HTTP client using the **`HttpClientFactory`**. You can specify which client to use based or you can just get any one of the HTTP client available in your system/server.

```
use CustomHTTP\HttpClientFactory;

$clientType = 'curl';
$httpClient = HttpClientFactory::create($clientType);

// Make a GET request
try {
    $response = $httpClient->get('https://example.com');
    echo $response;
} catch (Exception $e) {
    echo 'Error: ' . $e->getMessage();
}
```

**OR**

```
use CustomHTTP\HttpClientFactory;

$httpClient = new HttpClientFactory()->getClient();

// Make a GET request
try {
    $response = $httpClient->get('https://example.com');
    echo $response;
} catch (Exception $e) {
    echo 'Error: ' . $e->getMessage();
}
```

Supported HTTP Clients
----------------------

[](#supported-http-clients)

**PHP cURL:** A library that allows you to connect and communicate with different types of servers using various protocols, including HTTP.

**PHP Streams:** A built-in PHP method for handling HTTP requests using streams.

Examples
--------

[](#examples)

Making a POST Request Here's how to make a POST request using the custom HTTP client:

```
try {
    $response = $httpClient->post('https://example.com/api', [
        'body' => [
            'key1' => 'value1',
            'key2' => 'value2',
        ],
        'headers' => [
            'api_key' => 'your-api-key'
        ]
    ]);
    echo $response;
} catch (Exception $e) {
    echo 'Error: ' . $e->getMessage();
}
```

Other methods can also be used as like below:

```
try {
    $response = $httpClient->request('https://example.com/api', 'PUT', [
        'body' => [
            'key1' => 'value1',
            'key2' => 'value2',
        ],
        'headers' => [
            'api_key' => 'your-api-key'
        ]
    ]);
    echo $response;
} catch (Exception $e) {
    echo 'Error: ' . $e->getMessage();
}
```

License
-------

[](#license)

This project is licensed under the MIT License.

### Conclusion

[](#conclusion)

Feel free to modify any sections to better suit your package's specifics or to include additional features and documentation as needed. If you need further customization or additional sections, let me know!

Mail ID:

###  Health Score

15

—

LowBetter than 3% of packages

Maintenance28

Infrequent updates — may be unmaintained

Popularity3

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity19

Early-stage or recently created project

 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.

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/17108649?v=4)[Navin](/maintainers/Navinchinnasamy)[@Navinchinnasamy](https://github.com/Navinchinnasamy)

---

Top Contributors

[![Navinchinnasamy](https://avatars.githubusercontent.com/u/17108649?v=4)](https://github.com/Navinchinnasamy "Navinchinnasamy (2 commits)")

### Embed Badge

![Health badge](/badges/navinchinnasamy-custom-http-client/health.svg)

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

###  Alternatives

[php-http/cache-plugin

PSR-6 Cache plugin for HTTPlug

25126.1M82](/packages/php-http-cache-plugin)[illuminate/http

The Illuminate Http package.

11937.9M7.0k](/packages/illuminate-http)[rdkafka/rdkafka

A PHP extension for Kafka

2.2k24.3k1](/packages/rdkafka-rdkafka)[httpsoft/http-message

Strict and fast implementation of PSR-7 and PSR-17

87965.9k114](/packages/httpsoft-http-message)[mezzio/mezzio-router

Router subcomponent for Mezzio

265.4M92](/packages/mezzio-mezzio-router)[serpapi/google-search-results-php

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

69127.2k](/packages/serpapi-google-search-results-php)

PHPackages © 2026

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