public function buildRequest($method, $uri, $payload, $headers)
{
$method = trim(strtoupper($method));
if ($method === 'GET') {
$params = $payload;
$body = [];
} else {
$params = [];
$body = $payload;
}
$url = $this->getUrl($uri, $params);
$headers = $this->getHttpHeaders($headers);
// Sparkpost API will not tolerate form feed in JSON.
$jsonReplace = ['\\f' => ''];
$body = strtr(json_encode($body), $jsonReplace);
return $this->getMessageFactory()->createRequest($method, $url, $headers, $body);
}