Mailjet\Client::_call PHP Method

_call() private method

Magic method to call a mailjet resource
private _call ( string $method, string $resource, string $action, array $args ) : Response
$method string Http method
$resource string mailjet resource
$action string mailjet resource action
$args array Request arguments
return Response server response
    private function _call($method, $resource, $action, $args)
    {
        $args = array_merge(['id' => '', 'actionid' => '', 'filters' => [], 'body' => '{}'], array_change_key_case($args));
        $url = $this->buildURL($resource, $action, $args['id'], $args['actionid']);
        $contentType = $action == 'csvdata/text:plain' || $action == 'csverror/text:csv' ? 'text/plain' : 'application/json';
        return (new Request([$this->apikey, $this->apisecret], $method, $url, $args['filters'], $args['body'], $contentType))->call($this->call);
    }