Extended HTTP Support
C PHP Other
Switch branches/tags
Clone or download
Pull request Compare This branch is 385 commits behind m6w6:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
tests
travis
.gitattributes
.gitignore
.gitmodules
.travis.yml
CREDITS
Exceptions.txt
KnownIssues.txt
LICENSE
README.md
TODO
ThanksTo.txt
bench_select_vs_event.php
check_package-xml.php
config.m4
config.w32
config9.m4
gen_curlinfo.php
gen_travis_yml.php
gen_utf8.php
package.xml
php_http.c
php_http.h
php_http_api.h
php_http_buffer.c
php_http_buffer.h
php_http_client.c
php_http_client.h
php_http_client_curl.c
php_http_client_curl.h
php_http_client_request.c
php_http_client_request.h
php_http_client_response.c
php_http_client_response.h
php_http_cookie.c
php_http_cookie.h
php_http_curl.c
php_http_curl.h
php_http_encoding.c
php_http_encoding.h
php_http_env.c
php_http_env.h
php_http_env_request.c
php_http_env_request.h
php_http_env_response.c
php_http_env_response.h
php_http_etag.c
php_http_etag.h
php_http_exception.c
php_http_exception.h
php_http_filter.c
php_http_filter.h
php_http_header.c
php_http_header.h
php_http_header_parser.c
php_http_header_parser.h
php_http_info.c
php_http_info.h
php_http_message.c
php_http_message.h
php_http_message_body.c
php_http_message_body.h
php_http_message_parser.c
php_http_message_parser.h
php_http_misc.c
php_http_misc.h
php_http_negotiate.c
php_http_negotiate.h
php_http_object.c
php_http_object.h
php_http_options.c
php_http_options.h
php_http_params.c
php_http_params.h
php_http_querystring.c
php_http_querystring.h
php_http_response_codes.h
php_http_url.c
php_http_url.h
php_http_utf8.h
php_http_version.c
php_http_version.h
reflection2php.php

README.md

pecl/http v2

Build Status

About:

Extended HTTP support. Again.

  • Introduces the http namespace.
  • PHP stream based message bodies.
  • Encapsulated env request/response.
  • Modular client support.

Installation:

This extension is hosted at PECL and can be installed with PEAR's pecl command:

# pecl install pecl_http

Dependencies:

pecl/http depends on a number of system libraries and PHP extensions for special features.

Required system libraries:

The following system libraries are required to build this extension:

zlib

Provides gzip/zlib/deflate encoding.
Minimum version: 1.2.0.4
Install on Debian: apt-get install zlib1g-dev

Optional system libraries:

The following system libraries are optional and provide additional features:

libidn

Provides IDNA support in URLs.
Minimum version: none
Install on Debian: apt-get install libidn11-dev

libidn2

Provides IDNA support in URLs (fallback if libidn is not available).
Minimum version: none
Install on Debian: apt-get install libidn2-0-dev

libicu

Provides IDNA support in URLs (fallback if libidn is not available).
Minimum version: none
Install on Debian: apt-get install libicu-dev

libcurl

Provides HTTP request functionality.
Minimum version: 7.18.2
Install on Debian: apt-get install libcurl4-openssl-dev
Note: There are usually different styles of SSL support for libcurl available, so you can replace 'openssl' in the above command f.e. with 'nss' or 'gnutls'.

libevent

Eventloop support for the HTTP client.
Minimum version: none
Install on Debian: apt-get install libevent-dev

PHP extensions:

This extension unconditionally depends on the pre-loaded presence of the following PHP extensions:

If configured --with-http-shared-deps (default) it depends on the pre-loaded presence of the following extensions, as long as they were available at build time:

  • hash
  • iconv
  • json (only until < 2.4.0)

Please ensure that all extension on which pecl/http depends, are loaded before it, e.g in your php.ini:

; obligatory deps
extension = raphf.so
extension = propro.so

; if shared deps were enabled
extension = hash.so
extension = iconv.so
extension = json.so

; finally load pecl/http
extension = http.so

Conflicts:

pecl/http-v2 conflicts with the following extensions:

  • http-v1
  • event (only until <= 2.0.3)

INI Directives:

  • http.etag.mode = "crc32b"
    Default hash method for dynamic response payloads to generate an ETag.

Stream Filters:

The http extension registers the http.* namespace for its stream filters. Provided stream filters are:

  • http.chunked_decode
    Decode a stream encoded with chunked transfer encoding.
  • http.chunked_encode
    Encode a stream with chunked transfer encoding.
  • http.inflate
    Decode a stream encoded with deflate/zlib/gzip encoding.
  • http.deflate
    Encode a stream with deflate/zlib/gzip encoding.

Documentation:

Documentation is available at https://mdref.m6w6.name/http