Download the PHP package initphp/http without Composer

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

InitPHP HTTP

Standards-compliant PSR-7 message, PSR-17 factory, PSR-18 client and SAPI response emitter for PHP 7.4+.

Latest Stable Version Total Downloads License PHP Version Require Tests Static Analysis

A single dependency-light package that ships the four building blocks every PHP project ends up wiring by hand: immutable HTTP messages, a unified factory, a cURL-backed client, and an emitter that converts a ResponseInterface into bytes on the wire.


Table of Contents


Features

Requirements

Component Minimum
PHP 7.4
ext-json always required
ext-curl required by InitPHP\HTTP\Client\Client (PSR-18 transport)
psr/http-message ^1.0 || ^2.0
psr/http-factory ^1.0
psr/http-client ^1.0

Tested on PHP 7.4, 8.0, 8.1, 8.2, 8.3 and 8.4 in CI.

Installation

Quick Start

Building a PSR-7 Request

Building a PSR-7 Response

Convenience producers on the concrete Response:

Sending an HTTP request (PSR-18)

Higher-level helpers when you don't want to build a Request by hand:

PSR-18 contract is honoured: 4xx/5xx responses are returned, not thrown. Only transport failures raise Psr\Http\Client\NetworkExceptionInterface.

Resilience: retry with exponential backoff + jitter

The client is single-attempt by default. Attach a RetryPolicy to opt in to automatic retries of transient failures — connection errors, timeouts and the retryable HTTP status set (408, 425, 429, 500, 502, 503, 504 by default) — with exponential backoff, bounded jitter, a hard max-attempts cap, and Retry-After support:

Behaviour and backward-compatibility:

Emitting a response (SAPI)

Range requests (Content-Range: bytes 0-1023/...) are honoured automatically.

Hydrating a ServerRequest from globals

The factory is stateless — every call returns a fresh instance computed from the supplied arrays. Safe under Swoole, RoadRunner, Octane and FrankenPHP.

Using the static facades

For projects that prefer terseness over explicit DI:

Each facade lazily resolves a singleton on first call; subsequent calls return the same instance. Facades are entirely optional — every facade is just a thin static wrapper over a concrete service class you can instantiate yourself.

Documentation

In-depth guides live under docs/:

PSR Compliance

This package is verified against the official compliance suites:

Suite Result
php-http/psr7-integration-tests passing
http-interop/http-factory-tests (PSR-17) passing
In-house PSR-18 smoke suite against the PHP built-in test server passing
In-house PSR-7 immutability suite passing

Relevant specs: PSR-7, PSR-17, PSR-18.

Migration from 2.x

Version 3.0 is a breaking release. The highlights:

See docs/upgrade-guide.md for the full migration walk-through and a copy-pasteable code-mod list.

Contributing

Contributions are welcome — bug reports, doc improvements, performance patches, anything.

Security

If you discover a security vulnerability please review the project's Security Policy and report it privately. Please do not file public GitHub issues for security problems.

License

MIT License — Copyright © Muhammet ŞAFAK and contributors.


All versions of http with dependencies

PHP Build Version
Package Version
Requires php Version >=7.4
ext-json Version *
psr/http-client Version ^1.0
psr/http-factory Version ^1.0
psr/http-message Version ^1.0 || ^2.0
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 initphp/http contains the following files

Loading the files please wait ...