Appearance
http
Utilities to perform HTTP requests
⚠️ WARNING: This API requires the
--- @unsafe truemetadata.
Functions
get(url : string, opt_headers : table): table
Performs a GET request
- url (
string) The URL to request - opt_headers (
table) (optional) Request headers - returns (
table) The response table:
| Key | type | Description |
|---|---|---|
status | number | The HTTP status code |
body | string | The raw response body |
headers | table | A table of response headers |
post(url : string, body : string, opt_headers : table): table
Performs a POST request
- url (
string) The URL to request - body (
string) The request body - opt_headers (
table) (optional) Request headers - returns (
table) The response table:
| Key | type | Description |
|---|---|---|
status | number | The HTTP status code |
body | string | The raw response body |
headers | table | A table of response headers |
