[.NET] Use collection expressions in docs
As of C# 12 we can now use collection expressions to reduce some boilerplate when initializing collections.
This commit is contained in:
@@ -156,7 +156,7 @@
|
||||
[csharp]
|
||||
var fields = new Godot.Collections.Dictionary { { "username", "user" }, { "password", "pass" } };
|
||||
string queryString = new HttpClient().QueryStringFromDict(fields);
|
||||
string[] headers = { "Content-Type: application/x-www-form-urlencoded", $"Content-Length: {queryString.Length}" };
|
||||
string[] headers = ["Content-Type: application/x-www-form-urlencoded", $"Content-Length: {queryString.Length}"];
|
||||
var result = new HttpClient().Request(HttpClient.Method.Post, "index.php", headers, queryString);
|
||||
[/csharp]
|
||||
[/codeblocks]
|
||||
|
||||
Reference in New Issue
Block a user