Download the PHP package berlioz/http-client without Composer

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

Berlioz HTTP Client

Latest Version Software license Build Status Quality Grade Total Downloads

Berlioz HTTP Client is a PHP library to request HTTP server with continuous navigation, including cookies, sessions... Implements PSR-18 (HTTP Client), PSR-7 (HTTP message interfaces) and PSR-17 (HTTP Factories) standards.

Installation

Composer

You can install Berlioz HTTP Client with Composer, it's the recommended installation.

Dependencies

Usage

Requests

With RequestInterface

You can construct your own request object whose implements RequestInterface interface (PSR-7).

Get/Post/Patch/Put/Delete/Options/Head/Connect/Trace

Methods are available to do request with defined HTTP method:

Example with Client::get():

You also can pass HTTP method in argument to Client::request(...) method:

Each method accept an array of options with $options argument. List of options:

Options passed in argument replace default options of client.

Session

The session is accessible with method Client::getSession().

History

The browsing history is saved in the session. If you serialize the object Session, the history is preserve.

The method Session::getHistory() returns an History object:

Cookies

A cookie manager is available to manage cookies of session and between requests. The manager is available with Session::getCookies() method.

If you serialize the object Session, the cookies are preserves.

HAR file

HAR file of session is accessible with method Session::getHar().

If you serialize the object Session, the HAR is preserved.

Refers to the documentation of elgigi/har-parser library: https://github.com/ElGigi/HarParser

Adapters

Usage

Default adapter used by library is CurlAdapter (if CURL extension is installed), else the StreamAdapter is used.

You can specify adapters to the client constructor, with argument adapter:

The first specified adapter is the default adapter.

If you want force an adapter for a request, you can pass is name in the request options:

List

List of adapters:

HarAdapter

The HarAdapter is specially made to simulate a navigation, coming from a desktop browser for example.

It's very useful for test units. You only need to store your cleaned HAR file into your repository to launch tests with simulated HTTP dialogs.

Har adapter accept an option strict (default: false) to force the way of navigation.

Create an adapter

You can create an adapter for your project. You must implement the interface Berlioz\Http\Client\Adapter\AdapterInterface.


All versions of http-client with dependencies

PHP Build Version
Package Version
Requires php Version ^8.0
ext-mbstring Version *
ext-zlib Version *
berlioz/http-message Version ^2.1
elgigi/har-parser Version ^1.0
psr/http-client Version ^1.0
psr/log Version ^1.0 || ^2.0 || ^3.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 berlioz/http-client contains the following files

Loading the files please wait ....