From 05a9609a9fd8ab38d8f29ca5ffc3920ea46bbc0b Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Wed, 27 Sep 2023 01:08:24 +0000 Subject: [PATCH] update slate[no ci] --- docs/game_data/spel2.lua | 10 ++++++++++ docs/index.html | 19 +++++++++++++++++++ docs/light.html | 19 +++++++++++++++++++ docs/src/includes/_globals.md | 19 +++++++++++++++++++ 4 files changed, 67 insertions(+) diff --git a/docs/game_data/spel2.lua b/docs/game_data/spel2.lua index 77d49cbc8..0c13e7ec5 100644 --- a/docs/game_data/spel2.lua +++ b/docs/game_data/spel2.lua @@ -1638,6 +1638,16 @@ function udp_send(host, port, msg) end ---Hook the sendto and recvfrom functions and start dumping network data to terminal ---@return nil function dump_network() end +---Send a synchronous HTTP GET request and return response as a string or nil on an error +---@param url string +---@return string? +function http_get(url) end +---Send an asynchronous HTTP GET request and run the callback when done. If there is an error, response will be nil and vice versa. +---The callback signature is nil on_data(string response, string error) +---@param url string +---@param on_data fun(response: string, error: string): nil +---@return HttpRequest +function http_get_async(url, on_data) end ---Check if the user has performed a feat (Real Steam achievement or a hooked one). Returns: `bool unlocked, bool hidden, string name, string description` ---@param feat FEAT ---@return boolean, boolean, string, string diff --git a/docs/index.html b/docs/index.html index f6d0e72f8..fb35de00f 100644 --- a/docs/index.html +++ b/docs/index.html @@ -770,6 +770,12 @@
Grow vines from GROWABLE_VINE
and VINE_TREE_TOP
entities in a level, area
default is whole level, destroy_broken
default is false
++Search script examples for http_get
+
Send a synchronous HTTP GET request and return response as a string or nil on an error
+++Search script examples for http_get_async
+
Send an asynchronous HTTP GET request and run the callback when done. If there is an error, response will be nil and vice versa. +The callback signature is nil on_data(string response, string error)
Search script examples for import
diff --git a/docs/light.html b/docs/light.html index b4d4bf90e..8b57b29c3 100644 --- a/docs/light.html +++ b/docs/light.html @@ -770,6 +770,12 @@grow_vines ++ http_get + ++ http_get_async + import @@ -4601,6 +4607,19 @@grow_vines
Grow vines from GROWABLE_VINE
and VINE_TREE_TOP
entities in a level, area
default is whole level, destroy_broken
default is false
++Search script examples for http_get
+
Send a synchronous HTTP GET request and return response as a string or nil on an error
+++Search script examples for http_get_async
+
Send an asynchronous HTTP GET request and run the callback when done. If there is an error, response will be nil and vice versa. +The callback signature is nil on_data(string response, string error)
Search script examples for import
diff --git a/docs/src/includes/_globals.md b/docs/src/includes/_globals.md index ac8663cea..01babc41e 100644 --- a/docs/src/includes/_globals.md +++ b/docs/src/includes/_globals.md @@ -1364,6 +1364,25 @@ Grow pole from `GROWABLE_CLIMBING_POLE` entities in a level, `area` default is w Grow vines from `GROWABLE_VINE` and `VINE_TREE_TOP` entities in a level, `area` default is whole level, `destroy_broken` default is false +### http_get + + +> Search script examples for [http_get](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=http_get) + +#### optional<string> http_get(string url) + +Send a synchronous HTTP GET request and return response as a string or nil on an error + +### http_get_async + + +> Search script examples for [http_get_async](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=http_get_async) + +#### HttpRequest http_get_async(string url, function on_data) + +Send an asynchronous HTTP GET request and run the callback when done. If there is an error, response will be nil and vice versa. +The callback signature is nil on_data(string response, string error) + ### import