Syntax
HttpGet(context: any, url: string, cache?: boolean | number): stringArguments
| Name | Type | Description |
|---|---|---|
context | any | Self or context argument supplied when calling method-style helpers. |
url | string | HTTP or WebSocket URL to connect to. |
cache? | boolean | number | Boolean option that enables or disables this behavior. |
Returns
| Name | Type | Description |
|---|---|---|
body | string | HTTP response body. |
Description
Sends a GET request and returns the response body.
Call it with 3 parameter(s): context, url, cache. The argument table explains which values are required and which ones only refine the behavior.
It returns body (string). Use the returns table to separate successful values from nil results and recoverable errors.
Example
Example call with placeholder values.
local result = HttpGet(nil, "example", true)
print(result)