Search code examples
phpcurlhaxe

How do I make cURL requests using Haxe that is compiled to PHP?


I can't find anything regarding cURL on the Haxe API for PHP and I'm a bit lost. Can someone help me out?

sys.Http uses sockets on the compiled PHP which isn't my desired outcome.


Solution

  • Since haxe doesn't have all the php extensions built in you will likely have to use the Syntax features.

    There's a lot of options on that page but the 'code' function is pretty versatile and dangerous:

    Syntax.code("$tuCurl = curl_init();");
    

    Anyway, you should be able to use curl using some of those features!