HTTPRequest.request

Creates request on the underlying HTTPClient. If there is no configuration errors, it tries to connect using HTTPClient.connectToHost and passes parameters onto HTTPClient.request. Returns constant OK if request is successfully created. (Does not imply that the server has responded), constant ERR_UNCONFIGURED if not in the tree, constant ERR_BUSY if still processing previous request, constant ERR_INVALID_PARAMETER if given string is not a valid URL format, or constant ERR_CANT_CONNECT if not using thread and the HTTPClient cannot connect to host. Note: The request_data parameter is ignored if method is constant HTTPClient.METHOD_GET. 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.httpEscape for an example.

struct HTTPRequest
@nogc nothrow
GodotError
request
(
in String url
,
in PoolStringArray custom_headers = PoolStringArray.init
,
in bool ssl_validate_domain = true
,
in long method = 0
,
in String request_data = gs!""
)

Meta