-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Description
---@class http
---@field get fun(url: string, callback: fun(response: Response), headers: table|nil): nil Sends a GET request.
---@field delete fun(url: string, callback: fun(response: Response), headers: table|nil): nil Sends a DELETE request.
---@field head fun(url: string, callback: fun(response: Response), headers: table|nil): nil Sends a HEAD request.
---@field options fun(url: string, callback: fun(response: Response), headers: table|nil): nil Sends a OPTIONS request.
---@field post fun(url: string, data:table|string, callback: fun(response: Response), headers: table|nil): nil Sends a POST request.
---@field put fun(url: string, callback: fun(response: Response), headers: table|nil): nil Sends a PUT request.
---@field patch fun(url: string, data:table|string, callback: fun(response: Response), headers: table|nil): nil Sends a PATCH request.
---@field tick fun(): nil Updates Requests.
http = {}
---@class Response
---@field body string The response body.
---@field url string The requested URL.
---@field status number The HTTP status code.
---@field error_code number Error code, if any.
---@field redirect_count number Number of redirects followed.
---@field error string Error message, if any.
---@field reason string Status code reason phrase.
---@field headers table Response headers as key-value pairs.Metadata
Metadata
Assignees
Labels
No labels