CSHttpResponse
in package
Tags
Table of Contents
- __construct() : mixed
- Constructs the HTTP response object.
- getBody() : string
- Returns the string content that was returned by the server.
- getContentType() : string
- Returns the content type the server provided in its response.
- getDuration() : float
- Returns the duration of the call in seconds.
- getHeader() : CSHttpHeader
- Returns the definition for the header with the specified name.
- getHeaders() : array<string|int, mixed>
- Returns all headers the response has received from the server.
- getHTTPCode() : int
- Returns the HTTP code that was returned by the server.
- getRedirectCount() : int
- Returns the number of redirects that were made before the final url has been accessed.
- getRedirectUrl() : int
- Returns the redirect URL that the server provided.
- getUrl() : string
- Returns the URL the HTTP request was send to.
Methods
__construct()
Constructs the HTTP response object.
public
__construct(string $sBody, array<string|int, mixed> $aResult[, array<string|int, mixed> $aHeaders = array() ]) : mixed
Parameters
- $sBody : string
-
The result body that was obtained from the server.
- $aResult : array<string|int, mixed>
-
The information provided by the curl framework.
- $aHeaders : array<string|int, mixed> = array()
-
key/value pairs of header names and header values
Tags
Return values
mixed —getBody()
Returns the string content that was returned by the server.
public
getBody() : string
Tags
Return values
string —The result string from the server.
getContentType()
Returns the content type the server provided in its response.
public
getContentType() : string
Tags
Return values
string —The content type obtained from the server.
getDuration()
Returns the duration of the call in seconds.
public
getDuration() : float
Tags
Return values
float —The call duration in seconds.
getHeader()
Returns the definition for the header with the specified name.
public
getHeader(string $sName) : CSHttpHeader
Parameters
- $sName : string
-
The header name.
Tags
Return values
CSHttpHeader —The header definition matching the name
getHeaders()
Returns all headers the response has received from the server.
public
getHeaders() : array<string|int, mixed>
Tags
Return values
array<string|int, mixed> —All header values as CSHttpHeader-instances.
getHTTPCode()
Returns the HTTP code that was returned by the server.
public
getHTTPCode() : int
Tags
Return values
int —The HTTP code returned by the server for the HTTP request.
getRedirectCount()
Returns the number of redirects that were made before the final url has been accessed.
public
getRedirectCount() : int
Tags
Return values
int —The HTTP code returned by the server for the HTTP request.
getRedirectUrl()
Returns the redirect URL that the server provided.
public
getRedirectUrl() : int
Tags
Return values
int —The HTTP code returned by the server for the HTTP request.
getUrl()
Returns the URL the HTTP request was send to.
public
getUrl() : string
Tags
Return values
string —The target URL of the HTTP call.
