private void PrintRequestCompleted(int result, int responseCode, Array<string> headers, Array<byte> body) { GD.Print("result: ", result); GD.Print("response_code: ", responseCode); GD.Print("Headers count " + headers.Count); for (int j = 0; j < headers.Count; ++j) { GD.Print("header " + j + " " + headers[j]); } byte[] bytes = new byte[body.Count]; body.CopyTo(bytes, 0); string str = System.Text.Encoding.Default.GetString(bytes); GD.Print("str ", str); if (str.Empty()) { return; } JSONParseResult jsonParseResult = JSON.Parse(str); GD.Print("jsonParseResult is ", jsonParseResult); GD.Print("jsonParseResult.Result is ", jsonParseResult.Result); GD.Print("jsonParseResult.Result.GetType() " + jsonParseResult.Result.GetType()); Godot.Collections.Array arrResults = jsonParseResult.Result as Godot.Collections.Array; if (null == arrResults) { return; } GD.Print("arrResults count " + arrResults.Count); // for (int i = 0; i < arrResults.Count; ++i) // { // Godot.Collections.Dictionary dict = arrResults[i] as Godot.Collections.Dictionary; // GD.Print(dict["id"]); // GD.Print(dict["name"]); // GD.Print(dict["score"]); // } }
public void IsArray() { Godot.Collections.Array array = new Godot.Collections.Array(); Assert.IsType <Godot.Collections.Array>(array); }