Download the PHP package rehyved/php-http-client without Composer

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

HTTP Client for PHP

A HTTP Client implementation on top of the PHP cURL extension for PHP inspired by the builder pattern.

Build Status

This library uses a builder pattern similar to the Apache HTTP client Fluent API for Java. The goal is to provide a readable and maintainable way of writing HTTP request logic inside your PHP websites and applications.

Feedback is always welcome.

Installation

Prerequisites:

This library is available through Packagist and can be imported using Composer:

Usage

The goal with this library is to make it easy to produce HTTP requests in PHP whilst keeping the code readable and understandable. The main starting point for this is the HttpResponse class.

HttpRequest class

The following examples show different usages of the HttpRequest class to perform HTTP requests:

Overriding default configuration

Default configuration for some settings can be configured globally to prevent having to provide these values on each creation of an HttpRequest.

The following configuration options are available by defining the appropriate constants with define():

Request types

GET request

[https://httpbin.org]() is a nice service to test HTTP requests against, it provides several ways to try different kinds of requests with a configurable response

PUT request
POST request
DELETE request

Adding query parameters

Adding Headers

Adding Cookies

Basic Authentication

Authorization header

Changing request timeout

Disabling SSL certificate verification

NOTE: This feature is not recommended in a production system but is meant as a convenience option in test environments

HttpResponse class

The $response variable will hold an instance of HttpResponse. This type of object holds the resulting content of the HttpRequest and provides useful methods to extract further information.

Status handling

Header handling

Cookie handling

Response body handling

HttpStatus class

This class provides constants to retrieve the matching status code for an HTTP status as well as convenience methods to get the reason phrase and check the type of a status code.

Constants

The class provides constants for the HTTP statuses, for example:

Methods


All versions of php-http-client with dependencies

PHP Build Version
Package Version
Requires php Version >=7.0
ext-curl Version *
ext-dom Version *
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 rehyved/php-http-client contains the following files

Loading the files please wait ....