mirror of
https://github.com/godotengine/godot-docs.git
synced 2026-01-04 14:11:02 +03:00
Fixed example that was not working
This commit is contained in:
@@ -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)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user