Skip to content

Commit

Permalink
[impr-OpenMage#913] Mage_HTTP_Client_Curl::makeRequest() does not sup…
Browse files Browse the repository at this point in the history
…port json encoded strings
  • Loading branch information
viable-hartman authored and edannenberg committed Aug 24, 2020
1 parent 9c0155c commit 1f07860
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/Mage/HTTP/Client/Curl.php
Original file line number Diff line number Diff line change
Expand Up @@ -345,7 +345,7 @@ public function getStatus()
* Make request
* @param string $method
* @param string $uri
* @param array $params
* @param array|string $params pass an array to form post, pass a json encoded string to directly post json
* @return null
*/
protected function makeRequest($method, $uri, $params = array())
Expand All @@ -354,7 +354,7 @@ protected function makeRequest($method, $uri, $params = array())
$this->curlOption(CURLOPT_URL, $uri);
if($method == 'POST') {
$this->curlOption(CURLOPT_POST, 1);
$this->curlOption(CURLOPT_POSTFIELDS, http_build_query($params));
$this->curlOption(CURLOPT_POSTFIELDS, is_array($params) ? http_build_query($params) : $params);
} elseif($method == "GET") {
$this->curlOption(CURLOPT_HTTPGET, 1);
} else {
Expand Down

0 comments on commit 1f07860

Please sign in to comment.