Update documentation for edl module

This commit is contained in:
JeremyStar™ 2024-03-24 21:57:43 +01:00
parent 2200de33fa
commit 26af587ac1

View file

@ -7,7 +7,10 @@ Pulls files from the internet, awaitable and batchable.
## Functions ## Functions
### *Dictionary* <u>awaited_request</u>(*String* <u>url</u>, *HTTPClient.Method* <u>method</u> = *HTTPClient.Method.METHOD_GET*, *PackedStringArray* <u>headers</u> = *PackedStringArray([])*, *String* <u>data</u> = *""*) ### *Dictionary* <u>awaited_request</u>(*String* <u>url</u>, *HTTPClient.Method* <u>method</u> = *HTTPClient.Method.METHOD_GET*, *PackedStringArray* <u>headers</u> = *PackedStringArray([])*, *String* <u>data</u> = *""*)
Requests a file from the internet, awaitable. :::note[Awaiting required]
Using the `await` keyword is required for this function.
:::
Requests a file from the internet.
The returned `Dictionary` has the following structure (example): The returned `Dictionary` has the following structure (example):
```gdscript ```gdscript
@ -21,13 +24,19 @@ The returned `Dictionary` has the following structure (example):
------------------------------------------------------------------------------------ Equal to @GlobalScope.Error. If not 0/Error.OK = the request failed ------------------------------------------------------------------------------------ Equal to @GlobalScope.Error. If not 0/Error.OK = the request failed
``` ```
### *Variant* <u>oneline_awaited_request</u>(*String* <u>url</u>, *bool* <u>return_utf8</u> = *true*, *bool* <u>ignore_http_code</u> = *false* *HTTPClient.Method* <u>method</u> = *HTTPClient.Method.METHOD_GET*, *PackedStringArray* <u>headers</u> = *PackedStringArray([])*, *String* <u>data</u> = *""*) ### *Variant* <u>oneline_awaited_request</u>(*String* <u>url</u>, *bool* <u>return_utf8</u> = *true*, *bool* <u>ignore_http_code</u> = *false* *HTTPClient.Method* <u>method</u> = *HTTPClient.Method.METHOD_GET*, *PackedStringArray* <u>headers</u> = *PackedStringArray([])*, *String* <u>data</u> = *""*)
:::note[Awaiting required]
Using the `await` keyword is required for this function.
:::
Returns a file from the internet without returning the godot code, http code or headers. Useful for oneliners. Returns a file from the internet without returning the godot code, http code or headers. Useful for oneliners.
Returns `null` on error. To ignore HTTP errors (ie. non-200 statuses) set `ignore_http_code` to `true`. Returns `null` on error. To ignore HTTP errors (ie. non-200 statuses) set `ignore_http_code` to `true`.
Returns a UTF-8 string with `return_utf8` turned on, returns bytes when turned off. Returns a UTF-8 string with `return_utf8` turned on, returns bytes when turned off.
### *Array[Dictionary]* <u>batch_awaited_request</u>(*PackedStringArray* <u>urls</u>, *HTTPClient.Method* <u>method</u> = *HTTPClient.Method.METHOD_GET*, *PackedStringArray* <u>headers</u> = *PackedStringArray([])*, *String* <u>data</u> = *""*) ### *Array[Dictionary]* <u>batch_awaited_request</u>(*PackedStringArray* <u>urls</u>, *HTTPClient.Method* <u>method</u> = *HTTPClient.Method.METHOD_GET*, *PackedStringArray* <u>headers</u> = *PackedStringArray([])*, *String* <u>data</u> = *""*)
Requests multiple file from the internet, awaitable. :::note[Awaiting required]
Using the `await` keyword is required for this function.
:::
Requests multiple file from the internet.
The returned `Dictionary`s have the following structure (example): The returned `Dictionary`s have the following structure (example):
```gdscript ```gdscript