Adding a curl library?

Hello guys, i need to use cURL for an API but i don’t really know if we can with CFX

I’m thinking that i can add a external library, but how to ?

I think i need this one : GitHub - Lua-cURL/Lua-cURLv3: Lua binding to libcurl

Thanks for reading.

1 Like

You don’t need curl bindings, there is already a built-in function to send http requests

Thanks you !

i have tryed with the example given, but i got this error :

Do you know why ?

There is my code :

PerformHttpRequest(“”, function (errorCode, resultData, resultHeaders)

print("Returned error code:" .. tostring(errorCode))

print("Returned data:" .. tostring(resultData))

print("Returned result Headers:" .. tostring(resultHeaders))


(BTW i have to take the follows informations on this URL, with a GET method,


That was my code in PHP (it actually work) :

$ip = “”; //

$url = "" .$ip;

$curl = curl_init();
curl_setopt($curl, CURLOPT_URL, $url);
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);

$result = curl_exec($curl);

$reponse = json_decode($result, TRUE);