PeclHttp
in package
implements
ClientInterface
Uses
Psr7ToPeclHttp, PeclHttpToPsr7
HTTP client for the pecl_http extension
Driver is suitable for PeclHttp 3.x (PHP7) and 4.x (PHP 8) extension versions
PeclHttp used to be the name for the 1.x backend but this is no longer supported
Ported from the original Request/Response implementation
Interfaces, Classes, Traits and Enums
- ClientInterface
Table of Contents
- $httpAuthSchemes : array<string|int, mixed>
- Map of HTTP authentication schemes from Horde_Http constants to implementation specific constants.
- $options : Options
- $proxyTypes : array<string|int, mixed>
- Map of proxy types from Horde_Http to implementation specific constants.
- $responseFactory : ResponseFactoryInterface
- $streamFactory : StreamFactoryInterface
- __construct() : mixed
- sendRequest() : Horde_Http_Response_Base
- Send this HTTP request
- httpAuthScheme() : const
- Translates a Horde_Http::AUTH_* constant to implementation specific constants.
- httpOptions() : array<string|int, mixed>
- Generates the HTTP options for the request.
- proxyType() : const
- Translates a Horde_Http::PROXY_* constant to implementation specific constants.
- convertPeclHttpResponseToPsr7() : ResponseInterface
- Convert to PSR-7 format
- convertPsr7RequestToPeclHttp() : Request
- Convert to native format
Properties
$httpAuthSchemes
Map of HTTP authentication schemes from Horde_Http constants to implementation specific constants.
protected
array<string|int, mixed>
$httpAuthSchemes
= [\Horde\Http\Constants::AUTH_ANY => \http\Client\Curl\AUTH_ANY, \Horde\Http\Constants::AUTH_BASIC => \http\Client\Curl\AUTH_BASIC, \Horde\Http\Constants::AUTH_DIGEST => \http\Client\Curl\AUTH_DIGEST, \Horde\Http\Constants::AUTH_GSSNEGOTIATE => \http\Client\Curl\AUTH_GSSNEG, \Horde\Http\Constants::AUTH_NTLM => \http\Client\Curl\AUTH_NTLM]
$options
protected
Options
$options
$proxyTypes
Map of proxy types from Horde_Http to implementation specific constants.
protected
array<string|int, mixed>
$proxyTypes
= [\Horde\Http\Constants::PROXY_SOCKS4 => \http\Client\Curl\PROXY_SOCKS4, \Horde\Http\Constants::PROXY_SOCKS5 => \http\Client\Curl\PROXY_SOCKS5]
$responseFactory
protected
ResponseFactoryInterface
$responseFactory
$streamFactory
protected
StreamFactoryInterface
$streamFactory
Methods
__construct()
public
__construct(ResponseFactoryInterface $responseFactory, StreamFactoryInterface $streamFactory, Options $options) : mixed
Parameters
- $responseFactory : ResponseFactoryInterface
- $streamFactory : StreamFactoryInterface
- $options : Options
Return values
mixed —sendRequest()
Send this HTTP request
public
sendRequest(RequestInterface $request) : Horde_Http_Response_Base
Parameters
- $request : RequestInterface
Tags
Return values
Horde_Http_Response_Base —httpAuthScheme()
Translates a Horde_Http::AUTH_* constant to implementation specific constants.
protected
httpAuthScheme(string $httpAuthScheme) : const
Parameters
- $httpAuthScheme : string
-
A Horde_Http::AUTH_* constant.
Tags
Return values
const —An implementation specific authentication scheme constant.
httpOptions()
Generates the HTTP options for the request.
protected
httpOptions() : array<string|int, mixed>
Tags
Return values
array<string|int, mixed> —array with options
proxyType()
Translates a Horde_Http::PROXY_* constant to implementation specific constants.
protected
proxyType() : const
Tags
Return values
const —convertPeclHttpResponseToPsr7()
Convert to PSR-7 format
private
convertPeclHttpResponseToPsr7(Response $httpResponse) : ResponseInterface
Parameters
- $httpResponse : Response
Return values
ResponseInterface —The PSR-7 equivalent
convertPsr7RequestToPeclHttp()
Convert to native format
private
convertPsr7RequestToPeclHttp(RequestInterface $request) : Request
Parameters
- $request : RequestInterface
-
The PSR request to convert