Skip to content

Commit 70cce30

Browse files
viable-hartmanedannenberg
authored andcommitted
[impr-OpenMage#913] Mage_HTTP_Client_Curl::makeRequest() does not support json encoded strings
1 parent 49abf83 commit 70cce30

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/Mage/HTTP/Client/Curl.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -345,7 +345,7 @@ public function getStatus()
345345
* Make request
346346
* @param string $method
347347
* @param string $uri
348-
* @param array $params
348+
* @param array|string $params pass an array to form post, pass a json encoded string to directly post json
349349
* @return null
350350
*/
351351
protected function makeRequest($method, $uri, $params = array())
@@ -354,7 +354,7 @@ protected function makeRequest($method, $uri, $params = array())
354354
$this->curlOption(CURLOPT_URL, $uri);
355355
if($method == 'POST') {
356356
$this->curlOption(CURLOPT_POST, 1);
357-
$this->curlOption(CURLOPT_POSTFIELDS, http_build_query($params));
357+
$this->curlOption(CURLOPT_POSTFIELDS, is_array($params) ? http_build_query($params) : $params);
358358
} elseif($method == "GET") {
359359
$this->curlOption(CURLOPT_HTTPGET, 1);
360360
} else {

0 commit comments

Comments
 (0)