Miscellaneous

HttpGet

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

الصيغة

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

الوسائط

الاسمالنوعالوصف
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.

القيم الراجعة

الاسمالنوعالوصف
bodystringDownloaded response body string, cached body string, or an empty string when the request cannot be opened.

الوصف

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 parameter: context, url, cache. يوضح جدول arguments القيم المطلوبة والقيم التي تضبط السلوك.

يعيد body (string). استخدم جدول returns للفصل بين قيم النجاح ونتائج nil والأخطاء القابلة للمعالجة.

مثال

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

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