Click or drag to resize

HTTPClientQueryStringFromDict Method

Generates a GET/POST application/x-www-form-urlencoded style query string from a provided dictionary, e.g.:

var fields = {"username": "user", "password": "pass"}
var query_string = http_client.query_string_from_dict(fields)
# Returns "username=user&password=pass"

Furthermore, if a key has a null 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.

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"

Namespace:  Godot
Assembly:  GodotSharp (in GodotSharp.dll) Version: 1.0.0
Syntax
C#
public string QueryStringFromDict(
	Dictionary fields
)

Parameters

fields
Type: Godot.CollectionsDictionary

[Missing <param name="fields"/> documentation for "M:Godot.HTTPClient.QueryStringFromDict(Godot.Collections.Dictionary)"]

Return Value

Type: String

[Missing <returns> documentation for "M:Godot.HTTPClient.QueryStringFromDict(Godot.Collections.Dictionary)"]

See Also