Native cURL with CI

How can I use native cURL in the server instead of the cURL library in codeigniter? I have cURL code that I did in native cURL in PHP, but I want it to be implemented with CI, but CI does not recognize the action I want.

+3


source to share


2 answers


You can use something like Guzzel or Response

Both of them have quite extensive documentation and support



Example from Guzzel

$client = new GuzzleHttp\Client();
$res = $client->get('https://api.github.com/user', ['auth' =>  ['user', 'pass']]);
echo $res->getStatusCode();
// "200"
echo $res->getHeader('content-type');
// 'application/json; charset=utf8'
echo $res->getBody();
// {"type":"User"...'

      

0


source


I have been trying this great library build from philsturgeon a long time ago, it works great

https://github.com/philsturgeon/codeigniter-curl



read the documentation carefully on how this library will work

0


source







All Articles