Search by

Provides an API to handle HTTP requests.

Package info

github.com/ICanBoogie/HTTP

Homepage

pkg:composer/icanboogie/http

Statistics

Installs: 7 740

Dependents: 3

Suggesters: 0

Stars: 5

Open Issues: 0

6.0 2025-01-12 00:39 UTC

This package is auto-updated.

Last update: 2026-10-18 12:15:53 UTC


README

Release Code Coverage Packagist

The icanboogie/http package provides a foundation to handle HTTP requests, with representations for requests, request files, responses, and headers.

The following example is an overview of request processing:

<?php

namespace ICanBoogie\HTTP;

// The request is usually created from the $_SERVER super global.
$request = Request::from_server();

/* @var ResponderProvider $responder_provider */

// The Responder Provider matches a request with a Responder
$responder = $responder_provider->responder_for_request($request);

// The Responder responds to the request with a Response, it might also throw an exception.
$response = $responder->respond($request);

// The response is sent to the client.
(new SimpleResponseSender())->send($response->finalize($request));
# or
$response($request); // request is only necessary in file responses

Installation

composer require icanboogie/http

Documentation

  • Request: request creation, parameters, files, and context.
  • Response: response status, streaming, redirects, and file delivery.
  • Headers: header fields manipulation.
  • Responders: responders and their decorators.
  • Exceptions: HTTP-related exceptions.

Continuous Integration

The project is continuously tested by GitHub actions.

Test Static Analysis Code Style

Code of Conduct

This project adheres to a Contributor Code of Conduct. By participating in this project and its community, you're expected to uphold this code.

Contributing

See CONTRIBUTING for details.

License

icanboogie/http is released under the BSD-3-Clause.