fix: Set the content header for module lookups

pull/2161/head
iglocska 2017-05-02 16:42:45 +02:00
parent 0e085d9d9c
commit 68718fed99
1 changed files with 6 additions and 1 deletions

View File

@ -141,8 +141,13 @@ class Module extends AppModel {
} else {
$httpSocket = new HttpSocket(array('timeout' => Configure::read('Plugin.' . $moduleFamily . '_timeout') ? Configure::read('Plugin.' . $moduleFamily . '_timeout') : 10));
}
$request = array(
'header' => array(
'Content-Type' => 'application/json',
)
);
try {
if ($post) $response = $httpSocket->post($url . $uri, $post);
if ($post) $response = $httpSocket->post($url . $uri, $post, $request);
else $response = $httpSocket->get($url . $uri);
return json_decode($response->body, true);
} catch (Exception $e) {