![]() |
CURL problem - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: CodeIgniter 4 (https://forum.codeigniter.com/forumdisplay.php?fid=28) +--- Forum: CodeIgniter 4 Support (https://forum.codeigniter.com/forumdisplay.php?fid=30) +--- Thread: CURL problem (/showthread.php?tid=75568) |
CURL problem - mintwint - 02-22-2020 Hello! I ger null CSP with CURL request Curl standart code (work good for me): PHP Code: $ch = curl_init(); Equivalent CI: PHP Code: $result = $client->request('POST', 'http://127.0.0.1:8545/', [ 1 method work good. CI method response: Code: "CSP": null How do I go next? any ideas RE: CURL problem - dave friend - 02-22-2020 I think the problem is that the cURL class does not have a "data" option. It should be "body". Give this a try. PHP Code: $result = $client->request('POST', 'http://127.0.0.1:8545/', [ If that solves your problem you might want to try using the 'json' option. It adds the Content-Type = 'application/json' header and calls json_encode for you. PHP Code: $result = $client->request('POST', 'http://127.0.0.1:8545/', [ |