Hello all.
I have searched for similar topics, but I haven’t found an answer that solves my problem. I am trying to make GET requests with https work in Haxe. I have this code:
class HttpsTest {
public static function main() : Void {
trace(haxe.Http.requestUrl("https://api.github.com"));
}
}
If I run it with haxe -main HttpsTest --interp
, it gives the error “Https is only supported with -lib hxssl”.
I checked for the hxssl lib, and on their project page I found this:
Please note hxssl is depreciated from Haxe 3.3.0 on as it has been merged into Haxe core. This library is no longer maintained, but it will still work for previous versions of Haxe.
I am on Haxe 3.4.7, so according to this hxssl should not be neccesary, but Ok, I have installed it and tried again with haxe -main HttpsTest -lib hxssl --interp
. Now, the error is “You cannot use the library ‘hxssl’ inside a macro”.
By searching on the web, I found this:
It is fine, since I was just using --interp
for testing purporses. Although it says that support is coming on 4.1, I should be able to use https on other targets on 3.4.7, since the message on the hxssl page says that it is integrated into Haxe since 3.3.0.
So let’s try Python (without hxssl since it’s supposed to not be needed anymore):
haxe -main HttpsTest -python output.py
When I run the script with Python3, I get an error:
Traceback (most recent call last):
File "output.py", line 1812, in <module>
HttpsTest.main()
File "output.py", line 81, in main
print(str(haxe_Http.requestUrl("https://api.github.com")))
File "output.py", line 760, in requestUrl
h.request(False)
File "output.py", line 306, in request
self.customRequest(post,output)
File "output.py", line 323, in customRequest
raise _HxException("Https is only supported with -lib hxssl")
__main__._HxException: Https is only supported with -lib hxssl
So maybe hxssl is not integrated, so I will try by adding it:
haxe -main HttpsTest -lib hxssl -python output.py
But it looks like hxssl does not compile:
/home/javi/haxelib/hxssl/3,0,0-alpha/sys/ssl/Socket.hx:335: characters 9-12 : Type not found : Lib
/home/javi/haxelib/hxssl/3,0,0-alpha/sys/ssl/Socket.hx:334: lines 334-336 : Missing return: Dynamic
/home/javi/haxelib/hxssl/3,0,0-alpha/sys/ssl/Socket.hx:338: characters 33-36 : Type not found : Lib
Sorry if I am missing something obvious here, I am very new to Haxe, but this is driving me crazy.
Thank you for your help!