Wrapper for curl to create http requests

 Methods

Creates connector object

__construct() 
Inherited

access public
inherited_from \Moneybird\HttpClient::__construct()

Clean up

__destruct() 
Inherited

access public
inherited_from \Moneybird\HttpClient::__destruct()

Get headers

getHeaders() : array
Inherited

access public
inherited_from \Moneybird\HttpClient::getHeaders()

Returns

array

Get last response

getLastResponse() : string
Inherited

access public
inherited_from \Moneybird\HttpClient::getLastResponse()

Returns

string

Number of requests left

requestsLeft() : int
Inherited

inherited_from \Moneybird\HttpClient::requestsLeft()

Returns

int

Perform the request

send(string $url, string $requestMethod, string $data, array $headers) : string

access public

Parameters

$url

string

URL of request

$requestMethod

string

(GET|POST|PUT|DELETE)

$data

string

Data in string format

$headers

array

Exceptions

\Moneybird\HttpClient_Exception
\Moneybird\HttpClient_HttpStatusException
\Moneybird\HttpClient_UnknownHttpStatusException
\Moneybird\HttpClient_ConnectionErrorException

Returns

string

Not needed using Oauth

setAuth(string $username, string $password) : \Moneybird\HttpClient

access public

Parameters

$username

string

Username

$password

string

Password

Returns

Set Consumer and Token

setConsumerAndToken(\Moneybird\Lib\OAuthConsumer $consumer, \Moneybird\Lib\OAuthConsumer $token) : \Moneybird\HttpClient_Oauth

Set useragent

setUserAgent(string $userAgent) : \Moneybird\HttpClient
Inherited

access public
inherited_from \Moneybird\HttpClient::setUserAgent()

Parameters

$userAgent

string

Returns

Close connection

closeConnection() : \Moneybird\HttpClient
Inherited

access protected
inherited_from \Moneybird\HttpClient::closeConnection()

Returns

Execute request Redirects via cURL option CURLOPT_FOLLOWLOCATION won't work if safe mode or open basedir is active

exec() : \Moneybird\HttpClient
Inherited

Throws exceptions if httpStatus contains error status

handleError() 
Inherited

access protected
inherited_from \Moneybird\HttpClient::handleError()

Exceptions

\Moneybird\HttpClient_HttpStatusException
\Moneybird\HttpClient_UnknownHttpStatusException

Init connection

openConnection() : \Moneybird\HttpClient
Inherited

access protected
inherited_from \Moneybird\HttpClient::openConnection()

Exceptions

\Moneybird\HttpClient_ConnectionErrorException

Returns

Prepare DELETE request

preDeleteRequest() : \Moneybird\HttpClient
Inherited

access protected
inherited_from \Moneybird\HttpClient::preDeleteRequest()

Returns

Prepare GET request

preGetRequest() : \Moneybird\HttpClient
Inherited

access protected
inherited_from \Moneybird\HttpClient::preGetRequest()

Returns

Prepare POST request

prePostRequest($data) : \Moneybird\HttpClient
Inherited

access protected
inherited_from \Moneybird\HttpClient::prePostRequest()

Parameters

$data

Returns

Prepare PUT request

prePutRequest($data) : \Moneybird\HttpClient
Inherited

access protected
inherited_from \Moneybird\HttpClient::prePutRequest()

Parameters

$data

Returns

Set connection options

setConnectionOptions(array $options) : \Moneybird\HttpClient
Inherited

access protected
inherited_from \Moneybird\HttpClient::setConnectionOptions()

Parameters

$options

array

Exceptions

\Moneybird\HttpClient_ConnectionErrorException

Returns

 Properties

 

Verify host and peer

$verifyHostAndPeer : bool
Inherited

access protected
static
inherited_from \Moneybird\HttpClient::$$verifyHostAndPeer
 

Curl handler

$connection : resource
Inherited

access protected
inherited_from \Moneybird\HttpClient::$$connection
 

Connection defaults

$connectionOptions : array
Inherited

access protected
inherited_from \Moneybird\HttpClient::$$connectionOptions
 

$consumer

$consumer 

 

Http Status code

$httpStatus : int
Inherited

access protected
inherited_from \Moneybird\HttpClient::$$httpStatus
 

Headers of last request

$lastHeader : string
Inherited

access protected
inherited_from \Moneybird\HttpClient::$$lastHeader
 

Response string

$response : string
Inherited

access protected
inherited_from \Moneybird\HttpClient::$$response
 

Filehandler for temp file

$tmpFile : resource
Inherited

access protected
inherited_from \Moneybird\HttpClient::$$tmpFile
 

$token

$token