Monday, March 28, 2022

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

Issue

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!



Answered By - Confidant
Answer Checked By - Katrina (WPSolving Volunteer)