Enforce GDScript and C# dictionary spacing style guidelines in code samples
Co-authored-by: A Thousand Ships <96648715+AThousandShips@users.noreply.github.com> Co-authored-by: Micky <66727710+Mickeon@users.noreply.github.com>
This commit is contained in:
@@ -99,7 +99,7 @@
|
||||
Generates a GET/POST application/x-www-form-urlencoded style query string from a provided dictionary, e.g.:
|
||||
[codeblocks]
|
||||
[gdscript]
|
||||
var fields = {"username": "user", "password": "pass"}
|
||||
var fields = { "username": "user", "password": "pass" }
|
||||
var query_string = http_client.query_string_from_dict(fields)
|
||||
# Returns "username=user&password=pass"
|
||||
[/gdscript]
|
||||
@@ -112,7 +112,7 @@
|
||||
Furthermore, if a key has a [code]null[/code] value, only the key itself is added, without equal sign and value. If the value is an array, for each value in it a pair with the same key is added.
|
||||
[codeblocks]
|
||||
[gdscript]
|
||||
var fields = {"single": 123, "not_valued": null, "multiple": [22, 33, 44]}
|
||||
var fields = { "single": 123, "not_valued": null, "multiple": [22, 33, 44] }
|
||||
var query_string = http_client.query_string_from_dict(fields)
|
||||
# Returns "single=123&not_valued&multiple=22&multiple=33&multiple=44"
|
||||
[/gdscript]
|
||||
@@ -148,7 +148,7 @@
|
||||
To create a POST request with query strings to push to the server, do:
|
||||
[codeblocks]
|
||||
[gdscript]
|
||||
var fields = {"username" : "user", "password" : "pass"}
|
||||
var fields = { "username": "user", "password": "pass" }
|
||||
var query_string = http_client.query_string_from_dict(fields)
|
||||
var headers = ["Content-Type: application/x-www-form-urlencoded", "Content-Length: " + str(query_string.length())]
|
||||
var result = http_client.request(http_client.METHOD_POST, "/index.php", headers, query_string)
|
||||
|
||||
Reference in New Issue
Block a user