PHP Class Mailgun\Connection\RestClient

Afficher le fichier Open project: mailgun/mailgun-php Class Usage Examples

Protected Properties

Свойство Type Description
$apiHost string
$apiVersion string The version of the API to use.
$httpClient Http\Client\HttpClient
$sslEnabled boolean If we should use SSL or not.

Méthodes publiques

Méthode Description
__construct ( string $apiKey, string $apiHost, Http\Client\HttpClient $httpClient = null )
delete ( string $endpointUrl ) : stdClass
get ( string $endpointUrl, array $queryString = [] ) : stdClass
post ( string $endpointUrl, array $postData = [], array $files = [] ) : stdClass
put ( string $endpointUrl, mixed $putData ) : stdClass
responseHandler ( Psr\Http\Message\ResponseInterface $responseObj ) : stdClass
setApiVersion ( string $apiVersion ) : RestClient
setSslEnabled ( boolean $sslEnabled ) : RestClient

Méthodes protégées

Méthode Description
getHttpClient ( ) : Http\Client\HttpClient
getResponseExceptionMessage ( Psr\Http\Message\ResponseInterface $responseObj ) : string
prepareFile ( string $fieldName, string | array $filePath, integer $fileIndex ) : array Prepare a file for the postBody.
send ( string $method, string $uri, mixed $body = null, array $files = [], array $headers = [] ) : stdClass

Private Methods

Méthode Description
generateEndpoint ( string $apiEndpoint, string $apiVersion, boolean $ssl ) : string
getApiUrl ( $uri ) : string

Method Details

__construct() public méthode

public __construct ( string $apiKey, string $apiHost, Http\Client\HttpClient $httpClient = null )
$apiKey string
$apiHost string
$httpClient Http\Client\HttpClient

delete() public méthode

public delete ( string $endpointUrl ) : stdClass
$endpointUrl string
Résultat stdClass

get() public méthode

public get ( string $endpointUrl, array $queryString = [] ) : stdClass
$endpointUrl string
$queryString array
Résultat stdClass

getHttpClient() protected méthode

protected getHttpClient ( ) : Http\Client\HttpClient
Résultat Http\Client\HttpClient

getResponseExceptionMessage() protected méthode

protected getResponseExceptionMessage ( Psr\Http\Message\ResponseInterface $responseObj ) : string
$responseObj Psr\Http\Message\ResponseInterface
Résultat string

post() public méthode

public post ( string $endpointUrl, array $postData = [], array $files = [] ) : stdClass
$endpointUrl string
$postData array
$files array
Résultat stdClass

prepareFile() protected méthode

Prepare a file for the postBody.
protected prepareFile ( string $fieldName, string | array $filePath, integer $fileIndex ) : array
$fieldName string
$filePath string | array
$fileIndex integer
Résultat array

put() public méthode

public put ( string $endpointUrl, mixed $putData ) : stdClass
$endpointUrl string
$putData mixed
Résultat stdClass

responseHandler() public méthode

public responseHandler ( Psr\Http\Message\ResponseInterface $responseObj ) : stdClass
$responseObj Psr\Http\Message\ResponseInterface
Résultat stdClass

send() protected méthode

protected send ( string $method, string $uri, mixed $body = null, array $files = [], array $headers = [] ) : stdClass
$method string
$uri string
$body mixed
$files array
$headers array
Résultat stdClass

setApiVersion() public méthode

public setApiVersion ( string $apiVersion ) : RestClient
$apiVersion string
Résultat RestClient

setSslEnabled() public méthode

Deprecation: To be removed in 3.0
public setSslEnabled ( boolean $sslEnabled ) : RestClient
$sslEnabled boolean
Résultat RestClient

Property Details

$apiHost protected_oe property

protected string $apiHost
Résultat string

$apiVersion protected_oe property

The version of the API to use.
protected string $apiVersion
Résultat string

$httpClient protected_oe property

protected HttpClient,Http\Client $httpClient
Résultat Http\Client\HttpClient

$sslEnabled protected_oe property

If we should use SSL or not.
Deprecation: To be removed in 3.0
protected bool $sslEnabled
Résultat boolean