I get the error "USER ERROR: Condition "err != 0 && err != 1" is true. Returning: FAILED" only on compiled project

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

I’m doing some tests with http requests.
i have the following code on my scene

var http_request: HTTPRequest

# Called when the node enters the scene tree for the first time.
func _ready():
	http_request = HTTPRequest.new()
	add_child(http_request)
	http_request.request_completed.connect(self.on_request_completed)


func on_request_completed(result, response_code, headers, body):
	var json = JSON.new()
	print('created json')
	json.parse(body.get_string_from_utf8())
	print('parsed json')
	print(str(json))
	$CenterContainer/VBoxContainer/Label.text = str(json.get_data())


func _on_button_pressed():
	http_request.request("https://212.227.227.158/")
	print('request')

it works fine when debugging
enter image description here

but when i compile it and upload to the server it returns an error and i don’t understand why
enter image description here

The http request returns the correct json