game.HttpPost
Posts bytes to an HTTP or HTTPS URL and returns its response body.
Syntax
game:HttpPost(url: string, data: string, contentType: string?) -> string
Also available as
HttpPosthttpposthttp_postgame.HttpPostAsync
Parameters
| Parameter | Type | Description |
|---|---|---|
url | string | HTTP or HTTPS destination. |
data | string | Request-body bytes. |
contentType | string? | Content-Type value for the body. |
Returns
| Type | Description |
|---|---|
string | HTTP response body. |
Description
This is a body-only convenience API. The Async spelling uses the same yielding request path; it does not accept a callback. Use request to inspect status codes, headers or cookies, or to send custom headers. Network failures and unsuccessful HTTP responses raise errors. Returned bytes are not automatically executed or JSON-decoded.
Example
local body = game:HttpPost("https://httpbin.org/post", "example", "text/plain")
print(body)
These are Game executor contracts. Check build requirements and session lifetimes before using them.
