According to the OCM specification the body needs to be JSON encoded
see: https://github.com/GEANT/OCM-API/pull/37 Signed-off-by: Bjoern Schiessle <bjoern@schiessle.org>
This commit is contained in:
parent
e7f0e8ba03
commit
5ad86170c1
|
@ -134,7 +134,6 @@ class CloudFederationProviderManager implements ICloudFederationProviderManager
|
|||
public function sendShare(ICloudFederationShare $share) {
|
||||
$cloudID = $this->cloudIdManager->resolveCloudId($share->getShareWith());
|
||||
$ocmEndPoint = $this->getOCMEndPoint($cloudID->getRemote());
|
||||
|
||||
if (empty($ocmEndPoint)) {
|
||||
return false;
|
||||
}
|
||||
|
@ -142,7 +141,8 @@ class CloudFederationProviderManager implements ICloudFederationProviderManager
|
|||
$client = $this->httpClientService->newClient();
|
||||
try {
|
||||
$response = $client->post($ocmEndPoint . '/shares', [
|
||||
'body' => $share->getShare(),
|
||||
'body' => json_encode($share->getShare()),
|
||||
'headers' => ['content-type' => 'application/json'],
|
||||
'timeout' => 10,
|
||||
'connect_timeout' => 10,
|
||||
]);
|
||||
|
@ -181,7 +181,8 @@ class CloudFederationProviderManager implements ICloudFederationProviderManager
|
|||
$client = $this->httpClientService->newClient();
|
||||
try {
|
||||
$response = $client->post($ocmEndPoint . '/notifications', [
|
||||
'body' => $notification->getMessage(),
|
||||
'body' => json_encode($notification->getMessage()),
|
||||
'headers' => ['content-type' => 'application/json'],
|
||||
'timeout' => 10,
|
||||
'connect_timeout' => 10,
|
||||
]);
|
||||
|
|
Loading…
Reference in New Issue