Download the PHP package componenta/http without Composer

On this page you can find all versions of the php package componenta/http. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package http

Componenta HTTP

Minimal HTTP primitives shared by Componenta HTTP packages.

This package intentionally has no PSR-7 implementation, PSR-17 factory, middleware, responder, request creator, emitter, router, or application runtime. Those pieces live in separate packages so componenta/http can stay dependency-free.

Package Boundary

Included here Provided by another package
Componenta\Http\HttpMethod value object. PSR-7 request/response implementations are installed through componenta/http-psr-* integration packages.
Componenta\Http\Header constants. PSR request creation is in componenta/http-psr.
HTTP exception classes and HttpExceptionFactory. Response building is in componenta/http-responder.
No runtime wiring or config provider. Response emission is in componenta/http-emitter.
Middleware is split into componenta/http-body-parsing-middleware, componenta/http-cors-middleware, componenta/http-csrf-middleware, componenta/http-throttle-middleware, and componenta/http-trusted-proxy-middleware.
Pagination URL helpers are in componenta/http-pagination.

Installation

Requirements

The package has no Composer dependencies.

HTTP Method

HttpMethod normalizes method names and exposes RFC-oriented properties for common routing and middleware decisions.

Standard helpers are available for common methods:

Custom non-empty methods are allowed and normalized to uppercase. Use HttpMethod::tryFrom() when an empty value should return null instead of throwing.

Header Constants

Header groups common HTTP header names as constants and includes helper lists for request, response, security, cache, and CORS headers.

The class is a static helper and is not meant to be instantiated.

HTTP Exceptions

All status-specific exceptions extend Componenta\Http\Exception\HttpException.

HttpException exposes:

API Meaning
$exception->statusCode HTTP status code.
$exception->headers Headers that an HTTP error response generator may copy to the response.
withHeader(string $name, string|array $value) Adds a response header and returns the same exception instance.

Use HttpExceptionFactory::fromStatusCode() when the status code is known only at runtime.

HttpExceptionFactory::isClientError() and HttpExceptionFactory::isServerError() classify existing HttpException instances.

Some status-specific exceptions also store data that is needed to build a correct HTTP response:

Exception Extra behavior
UnauthorizedException::basic() / UnauthorizedException::bearer() Adds the WWW-Authenticate header.
MethodNotAllowedException Requires the allowed methods list and adds the Allow header.
ContentTooLargeException, TooManyRequestsException, ServiceUnavailableException Accept an optional retry delay and add Retry-After.
ServiceUnavailableException::maintenance() Calculates Retry-After from a maintenance end time.
RangeNotSatisfiableException Requires the total resource size and adds Content-Range.
UpgradeRequiredException Requires the target protocol and adds Upgrade.

HttpExceptionFactory::fromStatusCode() creates generic instances. Prefer the concrete constructors above when the response must include these headers.

Related Packages

Package Responsibility
componenta/http-psr Creates PSR-7 server requests through configured factories.
componenta/http-responder Builds PSR-7 responses from common PHP values.
componenta/http-emitter Emits PSR-7 responses to PHP output.
componenta/app-http Runs Componenta HTTP applications.

All versions of http with dependencies

PHP Build Version
Package Version
Requires php Version ^8.4
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package componenta/http contains the following files

Loading the files please wait ...