Property | Type | Description | |
---|---|---|---|
$endpoint | The api endpoint that gets prepended to all requests send through this resource. | ||
$sparkpost | SparkPost object used to make requests. |
Method | Description | |
---|---|---|
__construct ( |
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 = [] ) : |
Sends requests to SparkPost object to the resource endpoint. |
public __construct ( |
||
$sparkpost | - the sparkpost instance that this resource is attached to | |
$endpoint | string | - the endpoint that this resource wraps |
public delete ( $uri = '', $payload = [], $headers = [] ) |
public get ( $uri = '', $payload = [], $headers = [] ) |
public post ( $payload = [], $headers = [] ) |
public put ( $uri = '', $payload = [], $headers = [] ) |
public request ( $method = 'GET', $uri = '', $payload = [], $headers = [] ) : |
||
return | or SparkPostResponse depending on sync or async request |
protected $endpoint |