Added classref for HTTPClient and HTTPRequest

This commit is contained in:
J08nY 2016-06-03 18:01:16 +02:00
parent dd4eaa1005
commit 4c5439f8cd
1 changed files with 59 additions and 3 deletions

View File

@ -14395,8 +14395,11 @@ This approximation makes straight segments between each point, then subdivides t
</class> </class>
<class name="HTTPClient" inherits="Reference" category="Core"> <class name="HTTPClient" inherits="Reference" category="Core">
<brief_description> <brief_description>
Hyper-text transfer protocol client.
</brief_description> </brief_description>
<description> <description>
Hyper-text transfer protocol client. Supports SSL and SSL server certificate verification.
Can be reused to connect to different hosts and make many requests.
</description> </description>
<methods> <methods>
<method name="connect"> <method name="connect">
@ -14420,12 +14423,14 @@ This approximation makes straight segments between each point, then subdivides t
<argument index="0" name="connection" type="StreamPeer"> <argument index="0" name="connection" type="StreamPeer">
</argument> </argument>
<description> <description>
Set connection to use, for this client.
</description> </description>
</method> </method>
<method name="get_connection" qualifiers="const"> <method name="get_connection" qualifiers="const">
<return type="StreamPeer"> <return type="StreamPeer">
</return> </return>
<description> <description>
Return current connection.
</description> </description>
</method> </method>
<method name="request_raw"> <method name="request_raw">
@ -14440,6 +14445,9 @@ This approximation makes straight segments between each point, then subdivides t
<argument index="3" name="body" type="RawArray"> <argument index="3" name="body" type="RawArray">
</argument> </argument>
<description> <description>
Sends a raw request to the connected host. The url is what is normally behind the hostname, i.e. in [code]http://somehost.com/index.php[/code], url would be "index.php".
Headers are HTTP request headers.
Sends body raw, as a byte array, does not encode it in any way.
</description> </description>
</method> </method>
<method name="request"> <method name="request">
@ -14485,30 +14493,35 @@ This approximation makes straight segments between each point, then subdivides t
</method> </method>
<method name="close"> <method name="close">
<description> <description>
Cloces the current connection, allows for reusal of [HTTPClient].
</description> </description>
</method> </method>
<method name="has_response" qualifiers="const"> <method name="has_response" qualifiers="const">
<return type="bool"> <return type="bool">
</return> </return>
<description> <description>
Return whether this [HTTPClient] has a response available.
</description> </description>
</method> </method>
<method name="is_response_chunked" qualifiers="const"> <method name="is_response_chunked" qualifiers="const">
<return type="bool"> <return type="bool">
</return> </return>
<description> <description>
Return whether this [HTTPClient] has a response that is chunked.
</description> </description>
</method> </method>
<method name="get_response_code" qualifiers="const"> <method name="get_response_code" qualifiers="const">
<return type="int"> <return type="int">
</return> </return>
<description> <description>
Return the HTTP status code of the response.
</description> </description>
</method> </method>
<method name="get_response_headers"> <method name="get_response_headers">
<return type="StringArray"> <return type="StringArray">
</return> </return>
<description> <description>
Return the response headers.
</description> </description>
</method> </method>
<method name="get_response_headers_as_dictionary"> <method name="get_response_headers_as_dictionary">
@ -14524,32 +14537,35 @@ Example: (content-length:12), (Content-Type:application/json; charset=UTF-8)
<return type="int"> <return type="int">
</return> </return>
<description> <description>
Return the response's body length.
</description> </description>
</method> </method>
<method name="read_response_body_chunk"> <method name="read_response_body_chunk">
<return type="RawArray"> <return type="RawArray">
</return> </return>
<description> <description>
Reads one chunk from the response.
</description> </description>
</method> </method>
<method name="set_read_chunk_size"> <method name="set_read_chunk_size">
<argument index="0" name="bytes" type="int"> <argument index="0" name="bytes" type="int">
</argument> </argument>
<description> <description>
Sets the size of the buffer used and maximum bytes to read per iteration Sets the size of the buffer used and maximum bytes to read per iteration. see [method read_response_body_chunk]
</description> </description>
</method> </method>
<method name="set_blocking_mode"> <method name="set_blocking_mode">
<argument index="0" name="enabled" type="bool"> <argument index="0" name="enabled" type="bool">
</argument> </argument>
<description> <description>
If set to true, execute will wait until all data is read from the response. If set to true, execution will block until all data is read from the response.
</description> </description>
</method> </method>
<method name="is_blocking_mode_enabled" qualifiers="const"> <method name="is_blocking_mode_enabled" qualifiers="const">
<return type="bool"> <return type="bool">
</return> </return>
<description> <description>
Return whether blocking mode is enabled.
</description> </description>
</method> </method>
<method name="get_status" qualifiers="const"> <method name="get_status" qualifiers="const">
@ -14722,8 +14738,11 @@ Example: (content-length:12), (Content-Type:application/json; charset=UTF-8)
</class> </class>
<class name="HTTPRequest" inherits="Node" category="Core"> <class name="HTTPRequest" inherits="Node" category="Core">
<brief_description> <brief_description>
A Node with the ability to send HTTP requests.
</brief_description> </brief_description>
<description> <description>
A Node with the ability to send HTTP requests. Uses a [HTTPClient] internally, supports HTTPS.
Can be used to make HTTP requests or download files via HTTP.
</description> </description>
<methods> <methods>
<method name="request"> <method name="request">
@ -14736,76 +14755,91 @@ Example: (content-length:12), (Content-Type:application/json; charset=UTF-8)
<argument index="2" name="ssl_validate_domain" type="bool" default="true"> <argument index="2" name="ssl_validate_domain" type="bool" default="true">
</argument> </argument>
<description> <description>
Make a HTTP GET request. The url is the complete url including "http://" or "https://" which will be parsed for a host and a port.
The custom_headers are HTTP request headers which will be used. If User-Agent is not specified a Godot specific will be used.
The ssl_validate_domain specifies if in case of HTTPS the server certificate should be verified.
</description> </description>
</method> </method>
<method name="cancel_request"> <method name="cancel_request">
<description> <description>
Cancel the current request.
</description> </description>
</method> </method>
<method name="get_http_client_status" qualifiers="const"> <method name="get_http_client_status" qualifiers="const">
<return type="int"> <return type="int">
</return> </return>
<description> <description>
Return the current status of the underlying [HTTPClient].
</description> </description>
</method> </method>
<method name="set_use_threads"> <method name="set_use_threads">
<argument index="0" name="enable" type="bool"> <argument index="0" name="enable" type="bool">
</argument> </argument>
<description> <description>
Make this HTTPRequest use threads.
</description> </description>
</method> </method>
<method name="is_using_threads" qualifiers="const"> <method name="is_using_threads" qualifiers="const">
<return type="bool"> <return type="bool">
</return> </return>
<description> <description>
Whether this request is using threads.
</description> </description>
</method> </method>
<method name="set_body_size_limit"> <method name="set_body_size_limit">
<argument index="0" name="bytes" type="int"> <argument index="0" name="bytes" type="int">
</argument> </argument>
<description> <description>
Set the response body size limit.
</description> </description>
</method> </method>
<method name="get_body_size_limit" qualifiers="const"> <method name="get_body_size_limit" qualifiers="const">
<return type="int"> <return type="int">
</return> </return>
<description> <description>
Return current body size limit.
</description> </description>
</method> </method>
<method name="set_max_redirects"> <method name="set_max_redirects">
<argument index="0" name="amount" type="int"> <argument index="0" name="amount" type="int">
</argument> </argument>
<description> <description>
Set the maximum amount of redirects the request will follow.
</description> </description>
</method> </method>
<method name="get_max_redirects" qualifiers="const"> <method name="get_max_redirects" qualifiers="const">
<return type="int"> <return type="int">
</return> </return>
<description> <description>
Return the maximum amount of redirects that will be followed.
</description> </description>
</method> </method>
<method name="set_download_file"> <method name="set_download_file">
<argument index="0" name="path" type="String"> <argument index="0" name="path" type="String">
</argument> </argument>
<description> <description>
Set the file to download into. Outputs the response body into the file.
</description> </description>
</method> </method>
<method name="get_download_file" qualifiers="const"> <method name="get_download_file" qualifiers="const">
<return type="String"> <return type="String">
</return> </return>
<description> <description>
Return the file this request will download into.
</description> </description>
</method> </method>
<method name="get_downloaded_bytes" qualifiers="const"> <method name="get_downloaded_bytes" qualifiers="const">
<return type="int"> <return type="int">
</return> </return>
<description> <description>
Return the amount of bytes this HTTPRequest downloaded.
</description> </description>
</method> </method>
<method name="get_body_size" qualifiers="const"> <method name="get_body_size" qualifiers="const">
<return type="int"> <return type="int">
</return> </return>
<description> <description>
Return the response body length.
</description> </description>
</method> </method>
</methods> </methods>
@ -14820,31 +14854,45 @@ Example: (content-length:12), (Content-Type:application/json; charset=UTF-8)
<argument index="3" name="body" type="RawArray"> <argument index="3" name="body" type="RawArray">
</argument> </argument>
<description> <description>
This signal is emitted upon request completion.
</description> </description>
</signal> </signal>
</signals> </signals>
<constants> <constants>
<constant name="RESULT_SUCCESS" value="0"> <constant name="RESULT_SUCCESS" value="0">
Request successful.
</constant> </constant>
<constant name="RESULT_CHUNKED_BODY_SIZE_MISMATCH" value="1"> <constant name="RESULT_CHUNKED_BODY_SIZE_MISMATCH" value="1">
</constant> </constant>
<constant name="RESULT_CANT_CONNECT" value="2"> <constant name="RESULT_CANT_CONNECT" value="2">
Request failed while connecting.
</constant> </constant>
<constant name="RESULT_CANT_RESOLVE" value="3"> <constant name="RESULT_CANT_RESOLVE" value="3">
Request failed while resolving.
</constant> </constant>
<constant name="RESULT_CONNECTION_ERROR" value="4"> <constant name="RESULT_CONNECTION_ERROR" value="4">
Request failed due to connection(read/write) error.
</constant> </constant>
<constant name="RESULT_SSL_HANDSHAKE_ERROR" value="5"> <constant name="RESULT_SSL_HANDSHAKE_ERROR" value="5">
Request failed on SSL handshake.
</constant> </constant>
<constant name="RESULT_NO_RESPONSE" value="6"> <constant name="RESULT_NO_RESPONSE" value="6">
Request does not have a response(yet).
</constant> </constant>
<constant name="RESULT_BODY_SIZE_LIMIT_EXCEEDED" value="7"> <constant name="RESULT_BODY_SIZE_LIMIT_EXCEEDED" value="7">
Request exceded it's maximum size limit, see [method set_body_size_limit].
</constant> </constant>
<constant name="RESULT_REQUEST_FAILED" value="8"> <constant name="RESULT_REQUEST_FAILED" value="8">
Request failed. (unused)
</constant> </constant>
<constant name="RESULT_REDIRECT_LIMIT_REACHED" value="11"> <constant name="RESULT_DOWNLOAD_FILE_CANT_OPEN" value="9">
HTTPRequest couldn't open the download file.
</constant> </constant>
<constant name="RESULT_DOWNLOAD_FILE_WRITE_ERROR" value="10"> <constant name="RESULT_DOWNLOAD_FILE_WRITE_ERROR" value="10">
HTTPRequest couldn't write to the download file.
</constant>
<constant name="RESULT_REDIRECT_LIMIT_REACHED" value="11">
Request reached it's maximum redirect limit, see [method set_max_redirects].
</constant> </constant>
</constants> </constants>
</class> </class>
@ -30053,6 +30101,14 @@ This method controls whether the position between two cached points is interpola
<description> <description>
</description> </description>
</method> </method>
<method name="set_source_md5">
<argument index="0" name="idx" type="int">
</argument>
<argument index="1" name="md5" type="String">
</argument>
<description>
</description>
</method>
<method name="remove_source"> <method name="remove_source">
<argument index="0" name="idx" type="int"> <argument index="0" name="idx" type="int">
</argument> </argument>