Download the PHP package amphp/http without Composer

On this page you can find all versions of the php package amphp/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

amphp/http

AMPHP is a collection of event-driven libraries for PHP designed with fibers and concurrency in mind. amphp/http is a collection of basic HTTP primitives which can be shared by servers and clients.

Installation

This package can be installed as a Composer dependency.

This package requires PHP 8.1 or later.

Usage

This package provides basic primitives needed for HTTP clients and servers.

Status Codes

HTTP status codes are made human-readable via Amp\Http\HttpStatus. It includes a constant for each IANA registered status code. Additionally, a default reason is available via HttpStatus::getReason($code).

Cookies

HTTP cookies are specified by RFC 6265. This package implements parsers for the set-cookie and cookie headers. It further has a developer friendly API for creating such headers.

Note This library doesn't set standards regarding the cookie encoding. As such, the limitations of RFC 6265 apply to names and values. If you need to set arbitrary values for certain cookies, it's recommended to use an encoding mechanism like URL encoding or Base64.

Set-Cookie

The set-cookie header is used to create cookies. Servers send this header in responses and clients parse the headers if a response contains such headers. Every header contains exactly one header. Hence, the responsible class is called ResponseCookie.

Note More information about set-cookie can be obtained from the MDN reference or other sources.

ResponseCookie::fromHeader() accepts a header value and attempts to parse it. If the parsing succeeds, a ResponseCookie is returned. If not, null is returned. No exceptions are thrown, because received cookies are always user input and untrusted and malformed headers should be discarded according to the RFC.

Cookie

The cookie header is used to send cookies from a client to a server. Clients send this header in requests and servers parse the header if a request contains such a header. Clients must not send more than one such header. Hence, the responsible class is called RequestCookie.

Note More information about cookie can be obtained from the MDN reference or other sources.

RequestCookie::fromHeader() accepts a header value and attempts to parse it. If the parsing succeeds, an array of RequestCookie instances is returned. If not, an empty array is returned. No exceptions are thrown, because received cookies are always user input and untrusted and malformed headers should be discarded according to the RFC.

Headers

This package provides an HTTP header parser based on RFC 7230. It also provides a corresponding header formatter.

Parsing Headers

Amp\Http\Rfc7230::parseHeaders() parses raw headers into an array mapping header names to arrays of header values. Every header line must end with \r\n, also the last one.

Formatting Headers

Amp\Http\Rfc7230::formatHeaders() takes an array with the same format as parseHeaders() returns. It protects against header injections and other non-compliant header names and values.

Versioning

amphp/http follows the semver semantic versioning specification like all other amphp packages.

Note BC breaks that are strictly required for RFC compliance are not considered BC breaks. These include cases like wrong quote handling for cookies, where the RFC isn't too clear.

A lax parser will however not be changed unless it is necessary for security reasons.

Security

If you discover any security related issues, please email [email protected] instead of using the issue tracker.

License

The MIT License (MIT). Please see LICENSE for more information.


All versions of http with dependencies

PHP Build Version
Package Version
Requires php Version >=8.1
amphp/hpack Version ^3
amphp/parser Version ^1.1
league/uri-components Version ^2.4.2 | ^7.1
psr/http-message Version ^1 | ^2
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 amphp/http contains the following files

Loading the files please wait ....