Skip to content

Lua Documentation #4

@Nikodem2

Description

@Nikodem2
---@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

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions