SparkPost\ResourceBase::request PHP Method

request() public method

Sends requests to SparkPost object to the resource endpoint.
public request ( $method = 'GET', $uri = '', $payload = [], $headers = [] ) : SparkPostPromise
return SparkPostPromise or SparkPostResponse depending on sync or async request
    public function request($method = 'GET', $uri = '', $payload = [], $headers = [])
    {
        if (is_array($uri)) {
            $headers = $payload;
            $payload = $uri;
            $uri = '';
        }
        $uri = $this->endpoint . '/' . $uri;
        return $this->sparkpost->request($method, $uri, $payload, $headers);
    }