diff --git a/tutorials/networking/http_request_class.rst b/tutorials/networking/http_request_class.rst index 7a999ec9bf1..283437b2fda 100644 --- a/tutorials/networking/http_request_class.rst +++ b/tutorials/networking/http_request_class.rst @@ -78,20 +78,21 @@ look for the ``name`` field and print that to console. .. code-tab:: csharp using Godot; + using System.Text; public partial class MyNode : Node { public override void _Ready() { - GetNode("HTTPRequest").RequestCompleted += OnRequestCompleted; HttpRequest httpRequest = GetNode("HTTPRequest"); + httpRequest.RequestCompleted += OnRequestCompleted; httpRequest.Request("https://api.github.com/repos/godotengine/godot/releases/latest"); } private void OnRequestCompleted(long result, long responseCode, string[] headers, byte[] body) { - JsonParseResult json = Json.Parse(Encoding.UTF8.GetString(body)); - GD.Print(json.Result); + Godot.Collections.Dictionary json = Json.ParseString(Encoding.UTF8.GetString(body)).AsGodotDictionary(); + GD.Print(json["name"]); } }