Horde_Http_Response_Curl
extends Horde_Http_Response_Base
in package
HTTP response object for the curl backend.
Tags
Table of Contents
- $code : int
- HTTP response code.
- $headers : array<string|int, mixed>
- Response headers.
- $httpVersion : float
- HTTP protocol version that was used.
- $uri : string
- Fetched URI.
- $_body : string
- Response body.
- $_headers : Horde_Support_CaseInsensitiveArray
- Case-insensitive list of headers.
- $_info : array<string|int, mixed>
- Info on the request obtained from curl_getinfo().
- __construct() : mixed
- Constructor.
- getBody() : string
- Returns the body of the HTTP response.
- getHeader() : string
- Returns the value of a single response header.
- getStream() : mixed
- Returns a stream pointing to the response body that can be used with all standard PHP stream functions.
- _parseHeaders() : array<string|int, mixed>
- Parses an array of response headers, mindful of line continuations, etc.
- _parseInfo() : mixed
- Processes the results of curl_getinfo.
- _parseResult() : mixed
- Parses the combined header/body result from cURL.
Properties
$code
HTTP response code.
public
int
$code
$headers
Response headers.
public
array<string|int, mixed>
$headers
$httpVersion
HTTP protocol version that was used.
public
float
$httpVersion
$uri
Fetched URI.
public
string
$uri
$_body
Response body.
protected
string
$_body
$_headers
Case-insensitive list of headers.
protected
Horde_Support_CaseInsensitiveArray
$_headers
$_info
Info on the request obtained from curl_getinfo().
protected
array<string|int, mixed>
$_info
= array()
Methods
__construct()
Constructor.
public
__construct(string $uri, string $curlresult, array<string|int, mixed> $curlinfo) : mixed
Parameters
- $uri : string
- $curlresult : string
- $curlinfo : array<string|int, mixed>
Return values
mixed —getBody()
Returns the body of the HTTP response.
public
getBody() : string
Return values
string —HTTP response body.
getHeader()
Returns the value of a single response header.
public
getHeader(string $header) : string
Parameters
- $header : string
-
Header name to get ('Content-Type', 'Content-Length', etc.).
Return values
string —HTTP header value.
getStream()
Returns a stream pointing to the response body that can be used with all standard PHP stream functions.
public
getStream() : mixed
Return values
mixed —_parseHeaders()
Parses an array of response headers, mindful of line continuations, etc.
protected
_parseHeaders(array<string|int, mixed> $headers) : array<string|int, mixed>
Parameters
- $headers : array<string|int, mixed>
Return values
array<string|int, mixed> —_parseInfo()
Processes the results of curl_getinfo.
protected
_parseInfo(array<string|int, mixed> $curlinfo) : mixed
Parameters
- $curlinfo : array<string|int, mixed>
Return values
mixed —_parseResult()
Parses the combined header/body result from cURL.
protected
_parseResult(string $curlresult) : mixed
Parameters
- $curlresult : string