public function makeRequest($apiMethod, $request)
{
$this->apiMethod = $apiMethod;
$httpConfig = new PPHttpConfig(null, PPHttpConfig::HTTP_POST);
if ($this->apiContext->getHttpHeaders() != null) {
$httpConfig->setHeaders($this->apiContext->getHttpHeaders());
}
$this->runHandlers($httpConfig, $request);
// Serialize request object to a string according to the binding configuration
$formatter = FormatterFactory::factory($this->serviceBinding);
$payload = $formatter->toString($request);
// Execute HTTP call
$connection = PPConnectionManager::getInstance()->getConnection($httpConfig, $this->apiContext->getConfig());
$this->logger->info("Request: {$payload}");
$response = $connection->execute($payload);
$this->logger->info("Response: {$response}");
return array('request' => $payload, 'response' => $response);
}