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

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

krishnan/http-client
====================

Simple HTTP client for PHP

00PHP

Since Jul 22Pushed 2y ago1 watchersCompare

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

READMEChangelogDependenciesVersions (1)Used By (0)

Simple HTTP client for PHP
==========================

[](#simple-http-client-for-php)

Install

```
composer require krishnan/http-client

```

Import class

```
use Krishnan\Http\Http;
```

### GET request

[](#get-request)

```
$url    = "https://jsonplaceholder.typicode.com/comments";
$data   = [ 'postId' => 1 ];

$response = HTTP::get( $url, $data );
```

### POST request

[](#post-request)

```
$url    = "https://jsonplaceholder.typicode.com/posts";
$data   = [ 'title' => 'This is post title' ];

$response = HTTP::post( $url, $data );
```

### More options

[](#more-options)

```
$response = HTTP::get( $url, $data, $headers, $curlOptions );
$response = HTTP::post( $url, $data, $headers, $curlOptions );
```

### Useful methods

[](#useful-methods)

```
$response->getStatusCode(); // to get response code
$response->getHeaders(); // to get all headers as array
$response->getHeader($name); // to get specific header
$response->getBody(); // to get raw response body
$response->getJson(); // to get body as assoc array
$response->getObject(); // to get body as object
```

### Credits

[](#credits)

This repository is a clone of . Kudos to the original builder to build a very simple and efficient http client which can be easily understood and implemented by even a new programmer. I have cloned it as I will be making some changes for my projects.

###  Health Score

13

—

LowBetter than 1% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity0

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity21

Early-stage or recently created project

 Bus Factor1

Top contributor holds 50% 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://www.gravatar.com/avatar/bccfa898f6f03bde7d18e5f5fa10a89338a27cdef372cfa7c6476ee2184973b6?d=identicon)[krishnan](/maintainers/krishnan)

---

Top Contributors

[![khunt47](https://avatars.githubusercontent.com/u/42242127?v=4)](https://github.com/khunt47 "khunt47 (2 commits)")[![krishnan-ubuntu](https://avatars.githubusercontent.com/u/5563216?v=4)](https://github.com/krishnan-ubuntu "krishnan-ubuntu (2 commits)")

### Embed Badge

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

```
[![Health](https://phpackages.com/badges/krishnan-http-client/health.svg)](https://phpackages.com/packages/krishnan-http-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)
