File tree Expand file tree Collapse file tree 1 file changed +3
-2
lines changed
lib/internal/Magento/Framework/HTTP/Client Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -338,17 +338,18 @@ public function getStatus()
338
338
* @param string $method
339
339
* @param string $uri
340
340
* @param array $params
341
+ * @param bool $json
341
342
* @return void
342
343
* @SuppressWarnings(PHPMD.CyclomaticComplexity)
343
344
* @SuppressWarnings(PHPMD.NPathComplexity)
344
345
*/
345
- protected function makeRequest ($ method , $ uri , $ params = [])
346
+ protected function makeRequest ($ method , $ uri , $ params = [], $ json = false )
346
347
{
347
348
$ this ->_ch = curl_init ();
348
349
$ this ->curlOption (CURLOPT_URL , $ uri );
349
350
if ($ method == 'POST ' ) {
350
351
$ this ->curlOption (CURLOPT_POST , 1 );
351
- $ this ->curlOption (CURLOPT_POSTFIELDS , http_build_query ($ params ));
352
+ $ this ->curlOption (CURLOPT_POSTFIELDS , $ json ? json_encode ( $ params ) : http_build_query ($ params ));
352
353
} elseif ($ method == "GET " ) {
353
354
$ this ->curlOption (CURLOPT_HTTPGET , 1 );
354
355
} else {
You can’t perform that action at this time.
0 commit comments