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 5mo ago1 watchersCompare

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

READMEChangelog (1)DependenciesVersions (5)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

32

—

LowBetter than 69% of packages

Maintenance49

Moderate activity, may be stable

Popularity4

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity59

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

2261d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/34398865?v=4)[Christ Memory Sitorus](/maintainers/chimemoo)[@chimemoo](https://github.com/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

[php-http/cache-plugin

PSR-6 Cache plugin for HTTPlug

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

The Illuminate Http package.

11937.9M6.9k](/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.4M91](/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)
