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);