raxos / http
Http client and foundation.
Requires
- php: >=8.5
- ext-ctype: *
- ext-fileinfo: *
- ext-mbstring: *
- guzzlehttp/guzzle: ^7
- jetbrains/phpstorm-attributes: ^1.2
- psr/http-client: ^1
- psr/http-factory: ^1
- psr/http-message: ^1 || ^2
- raxos/collection: *
- raxos/contract: *
- raxos/datetime: *
- raxos/error: *
- raxos/foundation: *
Requires (Dev)
- pestphp/pest: ^5.0
- raxos/database: *
Suggests
- raxos/database: to use the Model constraint attribute.
Provides
None
Conflicts
None
Replaces
None
- dev-main
- 3.2.0
- 3.1.0
- 3.0.1
- 3.0.0
- 2.3.4
- 2.3.3
- 2.3.2
- 2.3.1
- 2.3.0
- 2.2.0
- 2.1.0
- 2.0.7
- 2.0.6
- 2.0.5
- 2.0.4
- 2.0.3
- 2.0.2
- 2.0.1
- 2.0.0
- 1.9.0
- 1.8.2
- 1.8.1
- 1.8.0
- 1.7.0
- 1.6.1
- 1.6.0
- 1.5.1
- 1.5.0
- 1.4.0
- 1.3.3
- 1.3.2
- 1.3.1
- 1.3.0
- 1.2.4
- 1.2.3
- 1.2.2
- 1.2.1
- 1.2.0
- 1.1.2
- 1.1.1
- 1.1.0
- 1.0.20
- 1.0.19
- 1.0.18
- 1.0.17
- 1.0.15
- 1.0.14
- 1.0.13
- 1.0.12
- 1.0.11
- 1.0.10
- 1.0.9
- 1.0.8
- 1.0.7
- 1.0.6
- 1.0.5
- 1.0.4
- 1.0.3
- 1.0.2
- 1.0.1
- 1.0.0
- 0.1.0
This package is auto-updated.
Last update: 2026-10-03 12:06:31 UTC
README
Raxos HTTP
Incoming requests, outgoing responses, HTTP clients, validation and file streaming.
Documentation | Packagist | Raxos
- Typed request maps, headers, methods, status codes and uploaded files.
- JSON, HTML, redirects, files and empty response types.
- A client using Guzzle and PSR-7, PSR-17 and PSR-18 adapters.
- Validation through PHP attributes and streamed byte-range responses.
Installation
Requires PHP 8.5 or later. Enable the ctype, fileinfo, mbstring PHP extensions. Composer checks the remaining package and extension dependencies declared in composer.json.
composer require "raxos/http:^3.2"
Usage
<?php declare(strict_types=1); use Raxos\Http\HttpMethod; use Raxos\Http\HttpRequest; use Raxos\Http\Response\JsonHttpResponse; require __DIR__ . '/vendor/autoload.php'; $request = HttpRequest::create(method: HttpMethod::GET, uri: '/products?limit=25'); $limit = (int)$request->query->get('limit'); $response = new JsonHttpResponse(['items' => [], 'limit' => $limit]); $response->send();
Use HttpRequest::createFromGlobals() at an HTTP entry point. Invalid or scalar JSON bodies are rejected when parsed as structured JSON. File streaming defaults to no throttle; invalid or multiple byte ranges return HTTP 416. Set a positive throttle explicitly when needed.
Documentation
Testing
Run this library's Pest suite from the Raxos workspace:
git clone --recurse-submodules https://github.com/basmilius/raxos.git
cd raxos
composer install
vendor/bin/pest --testsuite=http
See Testing Raxos for PHP extensions, integration services and coverage commands. The library's Tests workflow also runs in GitHub Actions.
License
MIT. Copyright (c) 2017 - present Bas Milius.