\MerchantAPI\HttpHttpClient

Class HttpClient. Handles HTTP Reqests.

Summary

Methods
Properties
Constants
__construct()
setCurlOption()
setCurlOptions()
getCurlOptions()
get()
post()
request()
send()
No public properties found
No constants found
No protected methods found
$curlOptions
N/A
No private methods found
No private properties found
N/A

Properties

$curlOptions

$curlOptions : array

Type

array

Methods

__construct()

__construct(array  $curlOptions = array()) 

HttpClient constructor.

Parameters

array $curlOptions
Warning: count(): Parameter must be an array or an object that implements Countable in phar:///Users/gidriss/miva/tools/api-sdk/sdk-tools/phpDocumentor.phar/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1293 Warning: count(): Parameter must be an array or an object that implements Countable in phar:///Users/gidriss/miva/tools/api-sdk/sdk-tools/phpDocumentor.phar/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1293

setCurlOption()

setCurlOption(  $option,   $value) : $this

Set a cURL option.

Parameters

$option
$value
Warning: count(): Parameter must be an array or an object that implements Countable in phar:///Users/gidriss/miva/tools/api-sdk/sdk-tools/phpDocumentor.phar/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1293 Warning: count(): Parameter must be an array or an object that implements Countable in phar:///Users/gidriss/miva/tools/api-sdk/sdk-tools/phpDocumentor.phar/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1293

Returns

$this

setCurlOptions()

setCurlOptions(array  $options) : $this

Merge an array of cURL options.

Parameters

array $options
Warning: count(): Parameter must be an array or an object that implements Countable in phar:///Users/gidriss/miva/tools/api-sdk/sdk-tools/phpDocumentor.phar/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1293 Warning: count(): Parameter must be an array or an object that implements Countable in phar:///Users/gidriss/miva/tools/api-sdk/sdk-tools/phpDocumentor.phar/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1293

Returns

$this

getCurlOptions()

getCurlOptions() : array

Get the cURL options.

Warning: count(): Parameter must be an array or an object that implements Countable in phar:///Users/gidriss/miva/tools/api-sdk/sdk-tools/phpDocumentor.phar/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1293 Warning: count(): Parameter must be an array or an object that implements Countable in phar:///Users/gidriss/miva/tools/api-sdk/sdk-tools/phpDocumentor.phar/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1293

Returns

array

get()

get(  $url, array  $query = array(), array  $headers = array()) : \MerchantAPI\Http\HttpResponse

Send a GET Request.

Parameters

$url
array $query
array $headers

Throws

\MerchantAPI\Http\HttpClientException

Returns

\MerchantAPI\Http\HttpResponse

post()

post(  $url, null  $content = null, array  $query = array(), array  $headers = array()) : \MerchantAPI\Http\HttpResponse

Send a POST request.

Parameters

$url
null $content
array $query
array $headers

Throws

\MerchantAPI\Http\HttpClientException

Returns

\MerchantAPI\Http\HttpResponse

request()

request(  $url, string  $content = '', string  $method = \MerchantAPI\Http\HttpMessage::HTTP_METHOD_GET, array  $query = array(), array  $headers = array()) : \MerchantAPI\Http\HttpResponse

Send a request.

Parameters

$url
string $content
string $method
array $query
array $headers

Throws

\MerchantAPI\Http\HttpClientException

Returns

\MerchantAPI\Http\HttpResponse