HTTPRequest doesn't call anything when called with any text as url

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

I call a HTTPRequest node’s request method with the text “not really a valid url”, but the request_completed signal isn’t called. Basically there is no request to be completed so it makes sense, that it doesn’t say the request is completed, but since I run it from user input, I need it to say me if something failed, even if the request isn’t made in the first place.

Anyone any ideas?

:bust_in_silhouette: Reply From: jgodfrey

You need to check for an error when calling request(). Something like:

var http_request = HTTPRequest.new()
var error = http_request.request("garbage")
if error != OK:
	# something went wrong