public function request($method, $location, array $headers = null, $body = null)
{
if ($headers) {
foreach ($headers as $k => $v) {
$this->client->setHeader($k, $v);
}
}
switch (strtoupper($method)) {
case 'POST':
case 'PUT':
case 'PATCH':
$response = $this->client->{$method}($location, $body);
break;
default:
$response = $this->client->{$method}($location);
break;
}
return new CurlClientAdapterResult($response);
}