will this code add a Http Request, do an http Request and then again delete the node?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By Cyber-Kun

Like the Question says I just wan’t to know if the following code will do an Http Request and then delete the http Request node so that I can reuse this function for a lot of requests without having to have 10 httpRequest nodes in the project and so it would be less code

func GetAreaList():
var http = HTTPRequest.new()
http.name = "GetAreaList"
add_child(http)
http.set_download_file(Global.path["arealist"])
http.request(Global.Url["AreasSearch"], Global.headers)
http.remove_child(http)
:bust_in_silhouette: Reply From: Moreus

just call your function when needed/wanted, with no deleting nodes

Ok so say I wanted to write a program wich needs to connect to the internet and I want to use only one HTTPRequest node to download a few json files. How would I know when the http request completely downloaded those files so that I could make a new request?

would It be done Downloading once ?:
Http.request_completed().connect(somefunc)

or is there some other way to verify that the file is completely done downloading?

Cyber-Kun | 2023-03-13 17:22

yes but I have a lot of requests that need to be done and I’d rather not have 5 HttpRequest nodes to work with If I could just use one to do all that stuff

Cyber-Kun | 2023-03-13 17:23