function request(options: HttpRequest): ()
HttpRequest
required
The options for the HTTP request.
Aliases:
http_request http.requestHttpRequest
| Field | Type | Description |
|---|---|---|
Url | string | The URL for the request. |
Method | string | The HTTP method to use. |
Body | string? | The body of the request. |
Headers | table? | A table of headers. |
Cookies | table? | A table of cookies. |
Response
| Field | Type | Description |
|---|---|---|
Body | string | The body of the response. |
StatusCode | number | The number status code of the response. |
StatusMessage | string | The status message of the response. |
Success | boolean | Whether or not the request was successful. |
Headers | table | A dictionary of headers. |
Example
local response = request({
Url = "https://httpbin.org", Method = "GET"
})
print(response.Success)
print(response.StatusCode)
print(response.StatusMessage)
