24 lines
1.1 KiB
Lua
24 lines
1.1 KiB
Lua
---@meta [api]
|
|
|
|
---@alias curl_callback fun(deserialized: table<string, any>)
|
|
|
|
---@class curl_opts
|
|
---@field url string The url to make the request to
|
|
---@field query table url query, append after the url
|
|
---@field body string | table The request body, can be a path to a file
|
|
---@field auth string | table Basic request auth, 'user:pass', or {"user", "pass"}
|
|
---@field form table request form
|
|
---@field raw table any additonal curl args
|
|
---@field dry_run boolean whether to return the args to be ran through curl
|
|
---@field output string download destination filepath
|
|
---@field timeout integer request timeout in mseconds
|
|
---@field http_version "HTTP/0.9" | "HTTP/1.0" | "HTTP/1.1" | "HTTP/2" | "HTTP/3" HTTP version to use
|
|
---@field proxy string proxy url in this format: [protocol://]host[:port]
|
|
---@field insecure boolean Allow insecure server connections
|
|
|
|
---@class curl_response
|
|
---@field exit integer The shell process exit code
|
|
---@field status integer The https response status
|
|
---@field headers table The https response headers
|
|
---@field body string The http response body
|