ParseCurlHttpClient

Implements \Parse\HttpClients\ParseHttpable

Class ParseCurlHttpClient - Curl http client

author

Ben Friedman ben@axolsoft.com

package

Parse\HttpClients

Methods

ParseCurlHttpClient 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

Gets the error code

getErrorCode() : integer

Response

integer

Gets the error message

getErrorMessage() : string

Response

string

Convert and return response headers as an array

getHeadersArray(string $headerContent) : array

Arguments

$headerContent

string

Raw headers to parse

Response

array

Return proper header size

getHeaderSize() : integer

Response

integer

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

Detect versions of Curl which report incorrect header lengths when using Proxies.

needsCurlProxyFix() : boolean

Response

boolean

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 the connection timeout

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 our cURL request in advance

setup() 

Constants

CURL_PROXY_QUIRK_VER

CURL_PROXY_QUIRK_VER
const

Curl Version which is unaffected by the proxy header length error.

CONNECTION_ESTABLISHED

CONNECTION_ESTABLISHED
const

"Connection Established" header text

Properties

Curl handle

parseCurl : \Parse\HttpClients\ParseCurl

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

cURL error code

curlErrorCode : integer
var

Type(s)

integer

cURL error message

curlErrorMessage : string
var

Type(s)

string

Response from our request

response : string
var

Type(s)

string