[.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:
parent
89001f91d2
commit
072ff85f82
17 changed files with 73 additions and 73 deletions
|
|
@ -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]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue