Miscellaneous

HttpPost

Performs a POST request for game:HttpPost(...) or game:HttpPostAsync(...) and returns the response body string or a request error string.

Söz dizimi

HttpPost(context: DataModel, url: string, body?: string, contentTypeOrCompatibility?: string | number | boolean, headersOrContentType?: table | string, headers?: table): string

Argümanlar

AdTipAçıklama
contextDataModelMethod-call self value. Use game:HttpPost(...) or game:HttpPostAsync(...).
urlstringURL string to request.
body?stringOptional request body. Defaults to an empty string.
contentTypeOrCompatibility?string | number | booleanNormally the content type string. A number uses legacy timeout mode, and a boolean uses legacy compression mode.
headersOrContentType?table | stringOptional headers table in the normal call shape, or optional content type string in legacy mode.
headers?tableOptional headers table used only in legacy mode. Keys and values must be strings without CR or LF.

Dönüşler

AdTipAçıklama
bodystringResponse body string or request error string.

Açıklama

Performs a POST request for game:HttpPost(...) or game:HttpPostAsync(...) and returns the response body string or a request error string. The URL must pass Real's URL restrictions.

6 parametre ile cagir: context, url, body, contentTypeOrCompatibility, headersOrContentType, headers. 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 POST request and return the response body string.

local body = game:HttpPost(
    "https://example.com",
    '{"hello":"world"}',
    "application/json",
    { ["X-Example"] = "Real" }
)

print(body)