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

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

tenaga/http
===========

Fast &amp; Simple HTTP Component

v1.1(6y ago)08[1 PRs](https://github.com/chimemoo/TenagaHttp/pulls)MITPHPCI passing

Since Apr 24Pushed 3mo ago1 watchersCompare

[ Source](https://github.com/chimemoo/TenagaHttp)[ Packagist](https://packagist.org/packages/tenaga/http)[ RSS](/packages/tenaga-http/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (1)DependenciesVersions (4)Used By (0)

TenagaHttp
==========

[](#tenagahttp)

Http Foundation for [Tenaga Framework](https://github.com/chimemoo/tenaga) Inspired by [PatrickLouys/http](https://github.com/PatrickLouys/http)

How to install?
===============

[](#how-to-install)

> composer require tenaga\\Http

Usage?
======

[](#usage)

Request
-------

[](#request)

Request give some function to access superglobals PHP variables. How to initialize? write some code like below

```
use Tenaga\Http\Request;
$request = new Request;
$request->set();
```

Then you can call some function below

```
# Get value from $_REQUEST superglobals variables
$request->all($key, $default = null);

# Get value from $_POST superglobals variables
$request->post($key, $default = null);

# Get value from $_GET superglobals variables
$request->get($key, $default = null);

# Get value from $_FILES superglobals variables
$request->file($key, $default = null);

# Get value from $_COOKIE[$key] superglobals variables
$request->cookie($key, $default = null);

# Get all parameters key & value that passe by $_GET and $_POST
$request->parameters();

# Get uri, i.e : test.com/test1/test2/...
$request->uri();

# Get url path, i.e : test1/test2/test3/.../...
$request->path();

# Get method that receive
$request->method();

# Get HTTP_ACCEPT for current request
$request->httpAccept();

# Get HTTP_REFERER for current request
$request->referer();

# Get user agent for current request
$request->userAgent();

# The IP address from which the user is viewing the current page.
$request->ipAddress();

# Check if the current page using https, that will return boolean
$request->isSecure();
```

Response
--------

[](#response)

Response give some function to prepare response in string type of variables. To initialize write some code below.

```
use Tenaga\Http\Response;
$response = new Response;
```

Then you can call some function below

```
# Set up the response
$response->setResponse($response);

# Get the response, you must add it at end
$response->getResponse();

# Append the current response
$response->appendResponse($response);
```

Header
------

[](#header)

Header will give you some function to manipulate header. To initialize write some code below.

```
use Tenaga\Http\Header;
$header = new Header;
```

Then you can some function below

```
# Set status code
$header->setStatusCode($statusCode , $statusText = null);

# Set content type that will show
$header->setContentType($type, $charset = NULL);

# Set expires
$header->setExpired($date);

# Set header
$header->setHeader($name,$value);

# Get all header
$header->getAllHeader();
```

Cookie
------

[](#cookie)

Cookie will give you to easily manipulate and add cookie. To initialize write some code below.

```
use Tenaga\Http\Cookie;
$cookie = new Cookie;
```

Then you can some function below

```
# Set cookie by just passing the cookie by an array
prepare(array $cookie);

# Set cookie name
setName(string $name);

# Set cookie value
setValue($value);

# Set Cookie expired
setExpired(int $time);

# Set cookie path
setPath($path);

# Set Cookie Domain
setDomain($domain);

# Set cookie secure (optional), default : false
setSecure(bool $secure);

# Set Http only (optional), default : false
setHttpOnly(bool $httpOnly);

# Create the cookie
create();
```

To use cookie you must write code like this

```
$cookie->prepare
       ->setName('ExampleCookie')
       ->setValue('Example')
       ->setExpired(3600)
       ->setPath('/')
       ->setDomain('localhost.com')
       ->setSecure(true)
       ->setHttpOnly(true)
       ->create();
```

You can call some or all of them, but you must use prepare for preparing cookie and at the end create() function for making the cookie

Or you can use prepare() function to create new cookie.

```
/**
 * List Of key of array
 * 0 => name
 * 1 => value
 * 2 => expire
 * 3 => path
 * 4 => domain (optional)
 * 5 => secure (optional)
 * 6 => httponly (optional)
*/
$cookieData = [
  'ExampleCookie',
  'Example',
  3600,
  '/',
  'localhost.com'
];
$cookie->prepare($cookieData)->create();
```

###  Health Score

33

—

LowBetter than 75% of packages

Maintenance53

Moderate activity, may be stable

Popularity4

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity58

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

2215d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/6d9214e6ef2eb58aa3c6c063b054ab26855f73f4e0844b948dfd74fefc2a55e4?d=identicon)[chimemoo](/maintainers/chimemoo)

---

Top Contributors

[![chimemoo](https://avatars.githubusercontent.com/u/34398865?v=4)](https://github.com/chimemoo "chimemoo (1 commits)")

---

Tags

httphttpfoundation

### Embed Badge

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

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

###  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)
