PHP Класс SparkPost\ResourceBase

Показать файл Открыть проект

Защищенные свойства (Protected)

Свойство Тип Описание
$endpoint The api endpoint that gets prepended to all requests send through this resource.
$sparkpost SparkPost object used to make requests.

Открытые методы

Метод Описание
__construct ( SparkPost $sparkpost, string $endpoint ) Sets up the Resource.
delete ( $uri = '', $payload = [], $headers = [] ) Sends delete request to API at the set endpoint.
get ( $uri = '', $payload = [], $headers = [] ) Sends get request to API at the set endpoint.
post ( $payload = [], $headers = [] ) Sends post request to API at the set endpoint.
put ( $uri = '', $payload = [], $headers = [] ) Sends put request to API at the set endpoint.
request ( $method = 'GET', $uri = '', $payload = [], $headers = [] ) : SparkPostPromise Sends requests to SparkPost object to the resource endpoint.

Описание методов

__construct() публичный Метод

Sets up the Resource.
public __construct ( SparkPost $sparkpost, string $endpoint )
$sparkpost SparkPost - the sparkpost instance that this resource is attached to
$endpoint string - the endpoint that this resource wraps

delete() публичный Метод

Sends delete request to API at the set endpoint.
public delete ( $uri = '', $payload = [], $headers = [] )

get() публичный Метод

Sends get request to API at the set endpoint.
public get ( $uri = '', $payload = [], $headers = [] )

post() публичный Метод

Sends post request to API at the set endpoint.
public post ( $payload = [], $headers = [] )

put() публичный Метод

Sends put request to API at the set endpoint.
public put ( $uri = '', $payload = [], $headers = [] )

request() публичный Метод

Sends requests to SparkPost object to the resource endpoint.
public request ( $method = 'GET', $uri = '', $payload = [], $headers = [] ) : SparkPostPromise
Результат SparkPostPromise or SparkPostResponse depending on sync or async request

Описание свойств

$endpoint защищенное свойство

The api endpoint that gets prepended to all requests send through this resource.
protected $endpoint

$sparkpost защищенное свойство

SparkPost object used to make requests.
protected $sparkpost