PHP Class EasyPost\Requestor

Exibir arquivo Open project: easypost/easypost-php

Public Properties

Property Type Description
$apiKey string

Public Methods

Method Description
__construct ( string $apiKey = null ) constructor
apiUrl ( string $url = '' ) : string get the API url
encode ( mixed $arr, null $prefix = null ) : string
handleApiError ( string $httpBody, integer $httpStatus, array $response )
handleCurlError ( integer $errorNum, string $message )
request ( string $method, string $url, mixed $params = null, $apiKeyRequired = true ) : array
utf8 ( mixed $value ) : string

Private Methods

Method Description
_curlRequest ( string $method, string $absUrl, mixed $headers, mixed $params, string $myApiKey ) : array
_encodeObjects ( mixed $d ) : array | string
_interpretResponse ( string $httpBody, integer $httpStatus ) : mixed
_requestRaw ( string $method, string $url, mixed $params, $apiKeyRequired ) : array

Method Details

__construct() public method

constructor
public __construct ( string $apiKey = null )
$apiKey string

apiUrl() public static method

get the API url
public static apiUrl ( string $url = '' ) : string
$url string
return string

encode() public static method

public static encode ( mixed $arr, null $prefix = null ) : string
$arr mixed
$prefix null
return string

handleApiError() public method

public handleApiError ( string $httpBody, integer $httpStatus, array $response )
$httpBody string
$httpStatus integer
$response array

handleCurlError() public method

public handleCurlError ( integer $errorNum, string $message )
$errorNum integer
$message string

request() public method

public request ( string $method, string $url, mixed $params = null, $apiKeyRequired = true ) : array
$method string
$url string
$params mixed
return array

utf8() public static method

public static utf8 ( mixed $value ) : string
$value mixed
return string

Property Details

$apiKey public_oe property

public string $apiKey
return string