Sintaxe
HttpGet(context: DataModel, url: string, cache?: boolean | number): stringArgumentos
| Nome | Tipo | Descrição |
|---|---|---|
context | DataModel | Method-call self value. Use game:HttpGet(url, cache) or game:HttpGetAsync(url, cache). |
url | string | URL string to request. |
cache? | boolean | number | Optional cache control. true or numeric 1 enables the URL cache. |
Retornos
| Nome | Tipo | Descrição |
|---|---|---|
body | string | Downloaded response body string, cached body string, or an empty string when the request cannot be opened. |
Descrição
Performs a GET request for game:HttpGet(url, cache) or game:HttpGetAsync(url, cache) and returns the response body string. The URL must pass Real's URL restrictions.
Chame com 3 parametro(s): context, url, cache. A tabela de argumentos explica quais valores sao obrigatorios e quais refinam o comportamento.
Retorna body (string). Use a tabela de retornos para separar valores bem sucedidos, nil e erros recuperaveis.
Exemplo
Run a DataModel-style GET request and return the response body string.
local body = game:HttpGet("https://example.com", true)
print(body)