ParseStreamHttpClient

Implements \Parse\HttpClients\ParseHttpable

Class ParseStreamHttpClient - Stream http client

author

Ben Friedman friedman.benjamin@gmail.com

package

Parse\HttpClients

Methods

ParseStreamHttpClient constructor.

__construct() 

Adds a header to this request

addRequestHeader(string $key, string $value) 

Arguments

$key

string

Header name

$value

string

Header value

Builds and returns the coalesced request headers

buildRequestHeaders() : array

Response

array

Converts unformatted headers to an array of headers

formatHeaders(array $rawHeaders) : array
static

Arguments

$rawHeaders

array

Response

array

Gets the error code

getErrorCode() : integer

Response

integer

Gets the error message

getErrorMessage() : string

Response

string

Returns the content type of the response

getResponseContentType() : null|string

Response

null|string

Gets headers in the response

getResponseHeaders() : array

Response

array

Returns the status code of the response

getResponseStatusCode() : integer

Response

integer

Extracts the Http status code from the given header

getStatusCodeFromHeader(string $header) : integer
static

Arguments

$header

string

Response

integer

Sends an HTTP request

send(string $url, string $method = 'GET', array $data = array()) : string
Throws
\Parse\ParseException

Arguments

$url

string

Url to send this request to

$method

string

Method to send this request via

$data

array

Data to send in this request

Response

string

Sets the CA file to validate requests with

setCAFile(string $caFile) 

Arguments

$caFile

string

CA file to set

Sets a connection timeout. UNUSED in the stream client.

setConnectionTimeout(integer $timeout) 

Arguments

$timeout

integer

Timeout to set

Sets the request timeout

setTimeout(integer $timeout) 

Arguments

$timeout

integer

Sets the timeout for the request

Sets up ssl related options for the stream context

setup() 

Properties

Stream handle

parseStream : \Parse\HttpClients\ParseStream

Request Headers

headers : array
var

Type(s)

array

Response headers

responseHeaders : array
var

Type(s)

array

Response code

responseCode : integer
var

Type(s)

integer

Content type of our response

responseContentType : string|null
var

Type(s)

string|null

Stream error code

streamErrorCode : integer
var

Type(s)

integer

Stream error message

streamErrorMessage : string
var

Type(s)

string

Options to pass to our stream

options : array
var

Type(s)

array

Optional CA file to verify our peers with

caFile : string
var

Type(s)

string

Optional timeout for this request

timeout : integer
var

Type(s)

integer