ExperimentalGear/docs/lua_api/http.lua

40 lines
1.1 KiB
Lua
Raw Normal View History

-- Global `Http` table
2024-02-02 02:43:06 +01:00
---@class Http
Http = {
}
---@class HttpResponse
---@field cookies string
---@field double number
---@field header table<string, string>
---@field status integer
---@field error string
---@field text string
---@field url string
HttpResponse = {}
-- Executes a blocking `GET` request
---@param url string
---@param header table<string, string>
---@return HttpResponse
2024-02-02 02:43:06 +01:00
Http.Get = function(url, header) end
-- Executes a `GET` request and calls `callback` with `HttpResponse` as a parameter
---@param url string
---@param header table<string, string>
---@param callback function
2024-02-02 02:43:06 +01:00
Http.GetAsync = function(url, header, callback) end
-- Executes a blocking `POST` request
---@param url string
---@param content string
---@param header table<string, string>
---@return HttpResponse
2024-02-02 02:43:06 +01:00
Http.Post = function(url, content, header) end
-- Executes a `POST` request and calls `callback` with `HttpResponse` as a parameter
---@param url string
---@param header table<string, string>
---@param callback function
2024-02-02 02:43:06 +01:00
Http.PostAsync = function(url, header, callback) end