From 730b4d629477fa1f2fc3a4bb10657da9af1fcca8 Mon Sep 17 00:00:00 2001 From: Juozas Rastenis Date: Sat, 2 Nov 2019 15:29:04 +0100 Subject: [PATCH] Fixed example that was not working --- tutorials/networking/http_request_class.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tutorials/networking/http_request_class.rst b/tutorials/networking/http_request_class.rst index 56b24bfa0..689557180 100644 --- a/tutorials/networking/http_request_class.rst +++ b/tutorials/networking/http_request_class.rst @@ -28,12 +28,12 @@ Below is all the code we need to make it work. The URL points to an online API m extends CanvasLayer func _ready(): - pass + $HTTPRequest.connect("request_completed", self, "_on_request_completed") func _on_Button_pressed(): $HTTPRequest.request("http://www.mocky.io/v2/5185415ba171ea3a00704eed") - func _on_HTTPRequest_request_completed( result, response_code, headers, body ): + func _on_request_completed(result, response_code, headers, body): var json = JSON.parse(body.get_string_from_utf8()) print(json.result)