I find this all a more than a bit ridiculous.
First I produce a working function that returns the json from a http request and you tell everyone it can't be done for the obscure reason that the httprequest implementation is buggy in WASM. Well, guess what, nobody is going to run their scripts in the browser version of TPT, plus I apparently did the impossible with my code.
Then there is the point that if my code doesn't work it bugs out after blocking the game for a few seconds and that's a huge issue, but if you create a tick() function that takes too much time and bugs out after a blocking the game for a few seconds that's no problem.
I'm an academically educated systems programmer and I'm about to give up responding in the forum because of the way you treat my input.
Anyways lets not start a flame because of that.
The code works thanks to both of you and it is good.
At least im not stuck with http requests anymore and can finally make the rest.