\mCASH\HttpClientCurlClient

CurlClient class.

Summary

Methods
Properties
Constants
instance()
request()
buildSignatureMessage()
sign_pkcs1()
No public properties found
No constants found
No protected methods found
No protected properties found
N/A
handleCurlError()
contentDigest()
sign()
encode()
$instance
N/A

Properties

$instance

$instance : mixed

instance

Type

mixed

Methods

instance()

instance() : static

instance function.

Returns

static

request()

request(mixed  $method, mixed  $absUrl, mixed  $params, mixed  $headers) : \mCASH\HttpClient\array($response,

request function.

Parameters

mixed $method

The HTTP method being used

mixed $absUrl

The URL being requested, including domain and protocol

mixed $params

KV pairs for parameters. Can be nested for arrays and hashes

mixed $headers

Headers to be used in the request (full strings, not KV pairs)

Returns

\mCASH\HttpClient\array($response, —

$code, $rheaders)

buildSignatureMessage()

buildSignatureMessage(mixed  $requestMethod, mixed  $url, mixed  $headers) : string

buildSignatureMessage function.

Parameters

mixed $requestMethod
mixed $url
mixed $headers

Returns

string

sign_pkcs1()

sign_pkcs1(mixed  $key, mixed  $data) : string

sign_pkcs1 function.

Parameters

mixed $key
mixed $data

Returns

string —

Throws Error\Base

handleCurlError()

handleCurlError(mixed  $url, mixed  $errno, mixed  $message) : void

handleCurlError function.

Parameters

mixed $url
mixed $errno
mixed $message

contentDigest()

contentDigest(string  $data) : string

contentDigest function.

Parameters

string $data

(default: "")

Returns

string

sign()

sign(mixed  $requestMethod, mixed  $url, mixed  $headers, mixed  $priv_key) : string

sign function.

Parameters

mixed $requestMethod
mixed $url
mixed $headers
mixed $priv_key

Returns

string

encode()

encode(mixed  $arr) : \mCASH\HttpClient\json

encode function.

Parameters

mixed $arr

Returns

\mCASH\HttpClient\json