2
0
Fork 0

Update to 26af587ac1aeb4af8f9e60242901dc7d20000915

This commit is contained in:
JeremyStar™ 2024-03-24 21:58:17 +01:00
parent 24ae3a10bf
commit 24831f2d67

View file

@ -40,6 +40,14 @@ func awaited_request(url: String, method: HTTPClient.Method = HTTPClient.Method.
list_complete.erase(id) list_complete.erase(id)
return dldata return dldata
func oneline_awaited_request(url: String, return_utf8: bool = true, ignore_http_code: bool = false, method: HTTPClient.Method = HTTPClient.Method.METHOD_GET, headers: PackedStringArray = PackedStringArray([]), data: String = "") -> Variant:
var dldata: Dictionary = await awaited_request(url, method, headers, data)
if dldata["result"] != Error.OK: return null
elif !ignore_http_code and dldata["http_code"] != 200: return null
else:
if return_utf8: return dldata["body_utf8"]
else: return dldata["body"]
func batch_awaited_request(urls: PackedStringArray, method: HTTPClient.Method = HTTPClient.Method.METHOD_GET, headers: PackedStringArray = PackedStringArray([]), data: String = "") -> Array[Dictionary]: func batch_awaited_request(urls: PackedStringArray, method: HTTPClient.Method = HTTPClient.Method.METHOD_GET, headers: PackedStringArray = PackedStringArray([]), data: String = "") -> Array[Dictionary]:
logger.verbf("Edl", "Creating " + str(urls.size()) + " awaited request(s)") logger.verbf("Edl", "Creating " + str(urls.size()) + " awaited request(s)")
var dldata: Array[Dictionary]= [] var dldata: Array[Dictionary]= []