Miscellaneous

HttpGet

Performs a GET request for game:HttpGet(url, cache) or game:HttpGetAsync(url, cache) and returns the response body string.

Söz dizimi

HttpGet(context: DataModel, url: string, cache?: boolean | number): string

Argümanlar

AdTipAçıklama
contextDataModelMethod-call self value. Use game:HttpGet(url, cache) or game:HttpGetAsync(url, cache).
urlstringURL string to request.
cache?boolean | numberOptional cache control. true or numeric 1 enables the URL cache.

Dönüşler

AdTipAçıklama
bodystringDownloaded response body string, cached body string, or an empty string when the request cannot be opened.

Açıklama

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.

3 parametre ile cagir: context, url, cache. Arguman tablosu hangi degerlerin zorunlu oldugunu ve hangilerinin davranisi incelttigini aciklar.

body (string) dondurur. Basarili degerleri, nil sonuclari ve toparlanabilir hatalari ayirmak icin return tablosunu kullan.

Örnek

Run a DataModel-style GET request and return the response body string.

local body = game:HttpGet("https://example.com", true)
print(body)