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

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

terrazza/http
=============

Terrazza Component Http

0181PHP

Since May 12Pushed 4y agoCompare

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

READMEChangelogDependenciesVersions (1)Used By (1)

the http component
==================

[](#the-http-component)

This component is for any interaction with/from Http

1. Object/Classes
    1. [Client](#structure-client)
    2. [Message](#structure-message)
    3. [Request](#structure-request)
    4. [Response](#structure-response)
    5. [Stream](#structure-stream)
2. [Install](#install)
3. [Requirements](#require)

Object/Classes
--------------

[](#objectclasses)

### Client

[](#client)

#### HttpClient

[](#httpclient)

common psr interface implementation.

### Message

[](#message)

#### Uri

[](#uri)

common psr interface implementation.

#### HttpMessageAdapter

[](#httpmessageadapter)

..description missing

#### HttpMessageHelper

[](#httpmessagehelper)

..description missing

### Request

[](#request)

implementations are really close to the common psr interfaces.
the differences are explained.

#### HttpClientRequest (RequestInterface)

[](#httpclientrequest-requestinterface)

- public function withContentType(string $contentType)
- public function withContent(string $contentType, $body)
- public function getPathParam(string $routeUri, string $argumentName)
- public function getQueryParam(string $argumentName)
- public function withQueryParams(array $query)
    *request-&gt;uri-&gt;query will be also updated*
- public function withUploadedFiles(array $uploadFiles)
- public function withUploadedFile(string $formDataName, UploadedFileInterface $uploadedFile)

#### HttpRequestFactory

[](#httprequestfactory)

HttpRequestFactory covers some HttpRequest methods.

##### method: getServerRequest() : IHttpServerRequest

[](#method-getserverrequest--ihttpserverrequest)

#### HttpRequestHelper (Trait)

[](#httprequesthelper-trait)

trait for common methods used in HttpRequest and HttpServerRequest.

#### HttpRequestMiddleware

[](#httprequestmiddleware)

HttpRequestMiddleware provides a middleware implementation.

#### HttpServerRequest (ServerRequestInterface)

[](#httpserverrequest-serverrequestinterface)

##### method: getServerParam(string $paramKey)

[](#method-getserverparamstring-paramkey)

##### method: getCookieParam(string $paramKey)

[](#method-getcookieparamstring-paramkey)

##### method: getPathParam(string $routeUri, string $argumentName)

[](#method-getpathparamstring-routeuri-string-argumentname)

##### method: getQueryParam(string $argumentName)

[](#method-getqueryparamstring-argumentname)

##### method: withQueryParams(array $queryParams)

[](#method-withqueryparamsarray-queryparams)

request-&gt;uri-&gt;query will be also updated

##### method: isValidBody()

[](#method-isvalidbody)

validate Content-Type against -&gt;body

#### HttpServerRequest

[](#httpserverrequest)

..description missing

### Response

[](#response)

all implementations are really close to psr interfaces. only the differences explained.

#### HttpResponse (ResponseInterface)

[](#httpresponse-responseinterface)

HttpResponse implements the common psr interface.

#### HttpResponseFactory (ResponseFactoryInterface)

[](#httpresponsefactory-responsefactoryinterface)

HttpResponseFactory implements the psr interface and

##### method: createJsonResponse(int $responseCode, $content)

[](#method-createjsonresponseint-responsecode-content)

### Stream

[](#stream)

#### HttpStream

[](#httpstream)

HttpStream implements the psr interface and

- \_\_constructor
    *is public and the class can be used directly*

##### method: getContents(bool $rewindAfterReading=false)

[](#method-getcontentsbool-rewindafterreadingfalse)

rewindAfterReading set stream-&gt;seek(0) to reuse the content

##### method: setMediaType(string $mediaType)

[](#method-setmediatypestring-mediatype)

set mime\_type. StreamFactory-&gt;createStreamFromFile will do this automatically

##### method: getMediaType()

[](#method-getmediatype)

##### method: setFileName(string $fileName)

[](#method-setfilenamestring-filename)

set fileName. StreamFactory-&gt;createStreamFromFile will do this automatically

##### method: getFileName()

[](#method-getfilename)

#### HttpStreamFactory

[](#httpstreamfactory)

HttpStreamFactory create the HttpStream directly without using any static functions. That allows us to inject the factory.

##### method: createStreamFromFile

[](#method-createstreamfromfile)

set, in case of a touchable file, mimeType and fileName to the HttpStream Object (IHttpStream).

#### UploadFile

[](#uploadfile)

- private function setStreamOrFile($streamOrFile)
    *streamOrFile
    . is a touchable file
    . or an instanceof IHttpStream
    ClientMediaType and ClientFilename are set, if present.*

Install
-------

[](#install)

### Install via composer

[](#install-via-composer)

```
composer require terrazza/component-http

```

Requirements
------------

[](#requirements)

### php version

[](#php-version)

- &gt;= 7.4

### php extension

[](#php-extension)

- ext-curl
- ext-json
- ext-fileinfo

###  Health Score

15

—

LowBetter than 3% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community5

Small or concentrated contributor base

Maturity26

Early-stage or recently created project

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/6aac82b92100438501756aab68d05fe45243631c8901ac45f75b07cef378ef04?d=identicon)[webfux](/maintainers/webfux)

### Embed Badge

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

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

Library for interacting with the Pusher REST API

1.5k94.8M293](/packages/pusher-pusher-php-server)[react/http

Event-driven, streaming HTTP client and server implementation for ReactPHP

78026.4M414](/packages/react-http)[php-http/curl-client

PSR-18 and HTTPlug Async client with cURL

48347.0M384](/packages/php-http-curl-client)[smi2/phpclickhouse

PHP ClickHouse Client

83510.1M71](/packages/smi2-phpclickhouse)

PHPackages © 2026

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