From d69c06ff0ac107c6d001f0d8917e03657951e56c Mon Sep 17 00:00:00 2001 From: Emil Huseynaliev Date: Sat, 3 Oct 2015 19:24:01 -0400 Subject: [PATCH] Fixes regression bug Non-image service requests should have the payload data json-encoded. --- src/Client.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Client.php b/src/Client.php index ca435f4..d8829d3 100644 --- a/src/Client.php +++ b/src/Client.php @@ -292,7 +292,8 @@ private function request($method, $endpoint, array $query=array(), array $payloa curl_setopt($ch, CURLOPT_CUSTOMREQUEST, $method); if ($method == 'POST') { - curl_setopt($ch, CURLOPT_POSTFIELDS, $payload); + $data = $img_svc_url ? $payload : json_encode($payload); + curl_setopt($ch, CURLOPT_POSTFIELDS, $data); } $result = curl_exec($ch);