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

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

attwframework/http
==================

HTTP component of AttwFramework

014PHP

Since Oct 5Pushed 11y ago1 watchersCompare

[ Source](https://github.com/AttwFramework/HTTP)[ Packagist](https://packagist.org/packages/attwframework/http)[ RSS](/packages/attwframework-http/feed)WikiDiscussions master Synced 1w ago

READMEChangelogDependenciesVersions (1)Used By (0)

HTTP
====

[](#http)

[![Total Downloads](https://camo.githubusercontent.com/ee3e21fe3d9a393d7532c4362807687d0c431e181846d7e6c37761142a6c0803/68747470733a2f2f706f7365722e707567782e6f72672f617474776672616d65776f726b2f687474702f646f776e6c6f6164732e706e67)](https://packagist.org/packages/attwframework/http) [![Latest Unstable Version](https://camo.githubusercontent.com/fa9bacfee2f8ea245a8104c1cfc4f8adcca7845069515fd72bb802d1b0e74b4d/68747470733a2f2f706f7365722e707567782e6f72672f617474776672616d65776f726b2f687474702f762f756e737461626c652e706e67)](https://packagist.org/packages/attwframework/http) [![License](https://camo.githubusercontent.com/3eb8a9e8d9455b4c763742de65dece0702bca1623341cf554555f58072d2ac48/68747470733a2f2f706f7365722e707567782e6f72672f617474776672616d65776f726b2f687474702f6c6963656e73652e706e67)](https://packagist.org/packages/attwframework/http)

HTTP component of [AttwFramework](https://github.com/attwframework/framework). ##Composer ###Download

```
{
    "require": {
        "attwframework/http": "dev-master"
    }
}
```

\##How to use ###Request This class exists to handle HTTP requests. Each one has a property on `\Attw\Http\Request` that returns an instance of `\Attw\Http\Request\Method\RequestsCollection`, that extends `\Attw\Tool\Collection\ArrayCollection`.

The values of each property can be defined on constructor of the request class. If null (`array()`), the value will be the properties of the globals (`$_GET`, `$_POST`, `$_FILES`, `$_SERVER`, `$_COOKIE`).

**Parameters order:** `Request([array $query = array(), [array $post = array(), [array $files = array(), [array $server = array(), [array $cookies = array()]]]]])`\####Example With globals:

```
use Attw\Http\Request;

$_GET['foo'] = 'bar';
$request = new Request();
echo $request->query->get('foo');// bar
```

Without globals:

```
use Attw\Http\Request;

$request = new Request(['bar' => 'foo']);
echo $request->query->get('bar');// foo
```

\###Response With it you can send a response to client machine. The response will send to the client if the request was executed with success (Status code is `200`) or not (Status code is not `200`), the content type to the brownser show (HTML, JSON, image, etc.) and others headers.

You can create a collection of headers to send all in the same time or send one each one.

On the instance of `\Attw\Http\Response` you can define the current status code and the version used of HTTP protocol: `Response([$statusCode = 200, [$protocol = 'HTTP/1.1']])`.

\####Example: Sending one header:

```
use Attw\Http\Response;

$response = new Response();
$response->sendHeader('Location', 'http://foo.bar'); //will redirect to http://foo.bar
```

Sending several headers:

```
$response->addHeader('Content-type', 'text/html');
$response->addHeader('Charset=UTF-8');
$response->sendAllHeaders();
```

\###Cookies Cookies are, basically, some data that the server "ask" client to save. Every time that you access that domain, your machine sends to it all cookies saved to it. A cookie is exclusive of you, of your machine.

The class used to set cookies is `\Attw\Http\Cookie\Cookies` and used to read a cookie is `\Attw\Http\Request`. ####Example

```
use Attw\Http\Cookie\Cookie;
use Attw\Http\Cookie\Cookies;
use Attw\Http\Request;

$cookies = new Cookies();
$cookie = new Cookie('foo', 'bar');//name: foo; value: bat
$cookies->set($cookie);
$request = new Request();
echo $request->cookie->get('foo');// bar
```

###  Health Score

20

—

LowBetter than 14% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity41

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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/4fcbdf815749595d3dcfd4fb781e2cac05aa6d132123aa9da889d2c5ca6c8e11?d=identicon)[GabrielJMJ](/maintainers/GabrielJMJ)

---

Top Contributors

[![gabrieljmj](https://avatars.githubusercontent.com/u/2223216?v=4)](https://github.com/gabrieljmj "gabrieljmj (16 commits)")

### Embed Badge

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

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