Click or drag to resize

HTTPRequestRequest Method

Creates request on the underlying HTTPClient. If there is no configuration errors, it tries to connect using ConnectToHost(String, Int32, Boolean, Boolean) and passes parameters onto Request(HTTPClientMethod, String, String, String).

Returns if request is successfully created. (Does not imply that the server has responded), if not in the tree, if still processing previous request, if given string is not a valid URL format, or if not using thread and the HTTPClient cannot connect to host.

Note: The request_data parameter is ignored if method is . This is because GET methods can't contain request data. As a workaround, you can pass request data as a query string in the URL. See String.http_escape for an example.

Namespace:  Godot
Assembly:  GodotSharp (in GodotSharp.dll) Version: 1.0.0
Syntax
C#
public Error Request(
	string url,
	string[] customHeaders = null,
	bool sslValidateDomain = true,
	HTTPClientMethod method = HTTPClientMethod.Get,
	string requestData = ""
)

Parameters

url
Type: SystemString

[Missing <param name="url"/> documentation for "M:Godot.HTTPRequest.Request(System.String,System.String[],System.Boolean,Godot.HTTPClient.Method,System.String)"]

customHeaders (Optional)
Type: SystemString
If the parameter is null, then the default value is new string[] {}
sslValidateDomain (Optional)
Type: SystemBoolean

[Missing <param name="sslValidateDomain"/> documentation for "M:Godot.HTTPRequest.Request(System.String,System.String[],System.Boolean,Godot.HTTPClient.Method,System.String)"]

method (Optional)
Type: GodotHTTPClientMethod

[Missing <param name="method"/> documentation for "M:Godot.HTTPRequest.Request(System.String,System.String[],System.Boolean,Godot.HTTPClient.Method,System.String)"]

requestData (Optional)
Type: SystemString

[Missing <param name="requestData"/> documentation for "M:Godot.HTTPRequest.Request(System.String,System.String[],System.Boolean,Godot.HTTPClient.Method,System.String)"]

Return Value

Type: Error

[Missing <returns> documentation for "M:Godot.HTTPRequest.Request(System.String,System.String[],System.Boolean,Godot.HTTPClient.Method,System.String)"]

See Also