ReferenceNetwork

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

ParameterTypeDescription
urlstringHTTP or HTTPS destination.
datastringRequest-body bytes.
contentTypestring?Content-Type value for the body.

Returns

TypeDescription
stringHTTP 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.