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

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

kingsoft/http
=============

Http Request/Response handler. It's a simple and easy to use library to handle http request and response.

3.8.3(1y ago)0363[4 issues](https://github.com/theking2/kingsoft-http/issues)2MITPHP

Since Jul 5Pushed 1y ago1 watchersCompare

[ Source](https://github.com/theking2/kingsoft-http)[ Packagist](https://packagist.org/packages/kingsoft/http)[ RSS](/packages/kingsoft-http/feed)WikiDiscussions main Synced 3w ago

READMEChangelog (10)Dependencies (1)Versions (60)Used By (2)

http
====

[](#http)

HTTP request, response, statuscodes

sample implementation
---------------------

[](#sample-implementation)

Sample implementation of the abstract Rest class under sample. Here a possible implementation:

```
use Kingsoft\Http\StatusCode;
use Kingsoft\PersistRest\PersistRest;
use Kingsoft\PersistRest\PersistRequest;
use Kingsoft\Http\Response;

class MyRest extends Rest
{
  public function get(): {
    Response::sendStatusCode( StatusCode::OK );
    Response::sendPayload( [ 'result'=> 'ok']);
  }
  public function post(): {
    Response::sendStatusCode( StatusCode::OK );
    Response::sendPayload( [ 'result'=> 'ok']);
  }
}

try {
  $request = new Request(
    [ 'Test' ],                         // allowed endpoints
                                        // when using persist-db discover.php the result will give you a plugin list.
    "GET, POST",                        // allowed methods, (might change to a string array in the future)
    "http://client.example.com",        // allowed origin
  );

  $request->setLogger( LOG );           // add a (monolog) logger
  $api = new MyRest( $request, LOG );   // create the request handler
  $api->handleRequest();                // handle the request, which will send a well-formed HATEOAS response
} catch ( Exception $e ) {              // If things go terribly wrong, send an error to the client
  Response::sendError( $e->getMessage(), StatusCode::InternalServerError );
                                        // By this time one or more errors have been logged already.
}
```

###  Health Score

33

—

LowBetter than 72% of packages

Maintenance42

Moderate activity, may be stable

Popularity12

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity58

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 78.9% 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 ~10 days

Recently: every ~25 days

Total

58

Last Release

478d ago

Major Versions

1.1.0 → 2.1.12023-07-11

2.7.2 → 3.0.02024-02-02

### Community

Maintainers

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

---

Top Contributors

[![theking2](https://avatars.githubusercontent.com/u/1612152?v=4)](https://github.com/theking2 "theking2 (101 commits)")[![kingma-sbw](https://avatars.githubusercontent.com/u/50140049?v=4)](https://github.com/kingma-sbw "kingma-sbw (27 commits)")

### Embed Badge

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

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

###  Alternatives

[symfony/http-kernel

Provides a structured process for converting a Request into a Response

8.1k853.6M8.3k](/packages/symfony-http-kernel)[symfony/http-client

Provides powerful methods to fetch HTTP resources synchronously or asynchronously

2.0k330.1M4.6k](/packages/symfony-http-client)[zircote/swagger-php

Generate interactive documentation for your RESTful API using PHP attributes (preferred) or PHPDoc annotations

5.3k140.4M554](/packages/zircote-swagger-php)[nelmio/api-doc-bundle

Generates documentation for your REST API from attributes

2.3k66.1M253](/packages/nelmio-api-doc-bundle)[matomo/matomo

Matomo is the leading Free/Libre open analytics platform

21.6k38.2k](/packages/matomo-matomo)[api-platform/metadata

API Resource-oriented metadata attributes and factories

244.5M182](/packages/api-platform-metadata)

PHPackages © 2026

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