Skip to content

Installation

Install HTTP with Composer.

shell
composer require raxos/http

Requirements

  • PHP 8.5 or newer.
  • The following PHP extensions:
    • ext-ctype
    • ext-fileinfo
    • ext-mbstring

Raxos dependencies

HTTP builds on a handful of other Raxos packages:

  • contract: the interfaces that HttpRequest, the responses, the client and the validator implement.
  • datetime: the Date, DateTime and Time validation constraints return raxos/datetime value objects.
  • error: all client and validation exceptions extend the base Raxos\Error\Exception class.
  • foundation: HttpRequest::ip() returns a raxos/foundation IP value object and the collection maps back the request.

The package also pulls in guzzlehttp/guzzle for the outgoing client, plus the psr/http-client, psr/http-factory and psr/http-message interfaces for the PSR bridge.

raxos/database

The Model and ModelArray validation constraints resolve request values into database ORM models. That package is only required when you use those two constraints, so it is a development and suggested dependency rather than a hard requirement.

Return to the HTTP introduction.