summaryrefslogtreecommitdiff
path: root/doc/classes/HTTPClient.xml
diff options
context:
space:
mode:
Diffstat (limited to 'doc/classes/HTTPClient.xml')
-rw-r--r--doc/classes/HTTPClient.xml37
1 files changed, 19 insertions, 18 deletions
diff --git a/doc/classes/HTTPClient.xml b/doc/classes/HTTPClient.xml
index 5a9d12d01b..645f328be0 100644
--- a/doc/classes/HTTPClient.xml
+++ b/doc/classes/HTTPClient.xml
@@ -4,7 +4,8 @@
Low-level hyper-text transfer protocol client.
</brief_description>
<description>
- Hyper-text transfer protocol client (sometimes called "User Agent"). Used to make HTTP requests to download web content, upload files and other data or to communicate with various services, among other use cases. [b]See the [HTTPRequest] node for a higher-level alternative.[/b]
+ Hyper-text transfer protocol client (sometimes called "User Agent"). Used to make HTTP requests to download web content, upload files and other data or to communicate with various services, among other use cases.
+ See the [HTTPRequest] node for a higher-level alternative.
[b]Note:[/b] This client only needs to connect to a host once (see [method connect_to_host]) to send multiple requests. Because of this, methods that take URLs usually take just the part after the host instead of the full URL, as the client is already connected to a host. See [method request] for a full example and to get started.
A [HTTPClient] should be reused between multiple requests or to connect to different hosts instead of creating one client per request. Supports SSL and SSL server certificate verification. HTTP status codes in the 2xx range indicate success, 3xx redirection (i.e. "try again, but over here"), 4xx something was wrong with the request, and 5xx something went wrong on the server's side.
For more information on HTTP, see https://developer.mozilla.org/en-US/docs/Web/HTTP (or read RFC 2616 to get it straight from the source: https://tools.ietf.org/html/rfc2616).
@@ -27,10 +28,10 @@
</method>
<method name="connect_to_host">
<return type="int" enum="Error" />
- <argument index="0" name="host" type="String" />
- <argument index="1" name="port" type="int" default="-1" />
- <argument index="2" name="use_ssl" type="bool" default="false" />
- <argument index="3" name="verify_host" type="bool" default="true" />
+ <param index="0" name="host" type="String" />
+ <param index="1" name="port" type="int" default="-1" />
+ <param index="2" name="use_ssl" type="bool" default="false" />
+ <param index="3" name="verify_host" type="bool" default="true" />
<description>
Connects to a host. This needs to be done before any requests are sent.
The host should not have http:// prepended but will strip the protocol identifier if provided.
@@ -96,7 +97,7 @@
</method>
<method name="query_string_from_dict">
<return type="String" />
- <argument index="0" name="fields" type="Dictionary" />
+ <param index="0" name="fields" type="Dictionary" />
<description>
Generates a GET/POST application/x-www-form-urlencoded style query string from a provided dictionary, e.g.:
[codeblocks]
@@ -134,10 +135,10 @@
</method>
<method name="request">
<return type="int" enum="Error" />
- <argument index="0" name="method" type="int" enum="HTTPClient.Method" />
- <argument index="1" name="url" type="String" />
- <argument index="2" name="headers" type="PackedStringArray" />
- <argument index="3" name="body" type="String" default="&quot;&quot;" />
+ <param index="0" name="method" type="int" enum="HTTPClient.Method" />
+ <param index="1" name="url" type="String" />
+ <param index="2" name="headers" type="PackedStringArray" />
+ <param index="3" name="body" type="String" default="&quot;&quot;" />
<description>
Sends a request to the connected host.
The URL parameter is usually just the part after the host, so for [code]https://somehost.com/index.php[/code], it is [code]/index.php[/code]. When sending requests to an HTTP proxy server, it should be an absolute URL. For [constant HTTPClient.METHOD_OPTIONS] requests, [code]*[/code] is also allowed. For [constant HTTPClient.METHOD_CONNECT] requests, it should be the authority component ([code]host:port[/code]).
@@ -162,10 +163,10 @@
</method>
<method name="request_raw">
<return type="int" enum="Error" />
- <argument index="0" name="method" type="int" enum="HTTPClient.Method" />
- <argument index="1" name="url" type="String" />
- <argument index="2" name="headers" type="PackedStringArray" />
- <argument index="3" name="body" type="PackedByteArray" />
+ <param index="0" name="method" type="int" enum="HTTPClient.Method" />
+ <param index="1" name="url" type="String" />
+ <param index="2" name="headers" type="PackedStringArray" />
+ <param index="3" name="body" type="PackedByteArray" />
<description>
Sends a raw request to the connected host.
The URL parameter is usually just the part after the host, so for [code]https://somehost.com/index.php[/code], it is [code]/index.php[/code]. When sending requests to an HTTP proxy server, it should be an absolute URL. For [constant HTTPClient.METHOD_OPTIONS] requests, [code]*[/code] is also allowed. For [constant HTTPClient.METHOD_CONNECT] requests, it should be the authority component ([code]host:port[/code]).
@@ -175,8 +176,8 @@
</method>
<method name="set_http_proxy">
<return type="void" />
- <argument index="0" name="host" type="String" />
- <argument index="1" name="port" type="int" />
+ <param index="0" name="host" type="String" />
+ <param index="1" name="port" type="int" />
<description>
Sets the proxy server for HTTP requests.
The proxy server is unset if [code]host[/code] is empty or [code]port[/code] is -1.
@@ -184,8 +185,8 @@
</method>
<method name="set_https_proxy">
<return type="void" />
- <argument index="0" name="host" type="String" />
- <argument index="1" name="port" type="int" />
+ <param index="0" name="host" type="String" />
+ <param index="1" name="port" type="int" />
<description>
Sets the proxy server for HTTPS requests.
The proxy server is unset if [code]host[/code] is empty or [code]port[/code] is -1.