Returns an array for the request headers.
public getHttpHeaders ( array $headers = [] ) : array | ||
$headers | array | - any custom headers for the request |
return | array | $headers - headers for the request |
public function testGetHttpHeaders() { $headers = $this->resource->getHttpHeaders(['Custom-Header' => 'testing']); $version = NSA::getProperty($this->resource, 'version'); $this->assertEquals('SPARKPOST_API_KEY', $headers['Authorization']); $this->assertEquals('application/json', $headers['Content-Type']); $this->assertEquals('testing', $headers['Custom-Header']); $this->assertEquals('php-sparkpost/' . $version, $headers['User-Agent']); }