HttpRequestOptions
HTTP method, URL, headers, body and per-request limits.
Example
Section titled “Example”This client fragment needs a running endpoint. The complete local HTTP recipe starts its own server and avoids a fixed port.
Where to put it: replace Src/Main.luau in a project created with this SDK. This is the complete entry file.
Project setup: add network.client to Capabilities in lui.json. See the capability guide.
local Window = Instance.new("Window", { Title = "LUI example", Size = UDim2.fromOffset(560, 280),})local Status = Instance.new("TextLabel", { Parent = Window, Text = "Ready", Position = UDim2.fromOffset(16, 170), Size = UDim2.new(1, -32, 0, 72),})local Button = Instance.new("TextButton", { Parent = Window, Text = "Try it", Size = UDim2.fromOffset(220, 44), Position = UDim2.fromOffset(16, 16),})Button.Text = "Request local status"Button.Activated:Connect(function() task.spawn(function() local Ok, Response = pcall(function() return app:GetService("HttpService"):RequestAsync({ Url = "http://127.0.0.1:8080/status", TimeoutMs = 3000, MaxResponseBytes = 4096, }) end) if not Ok then Status.Text = "Request could not complete"; return end Status.Text = "HTTP " .. Response.StatusCode .. ": " .. Response.Body end)end)Window.Visible = trueExpected result: With a local server on port 8080, pressing the button displays its status/body. Without one, it reports request failure without a dialog.
For source, manifest, pin and assets together, use the complete practical recipe.
Properties
Section titled “Properties”Complete http:// or https:// destination URL, subject to host policy.
Type: string. Read/write field.
Method
Section titled “Method”HTTP method; defaults to GET.
Type: string?. Read/write field.
Headers
Section titled “Headers”List of Name/Value records. It is not a dictionary indexed by header name.
Type: {HttpHeader}?. Read/write field.
Optional string or buffer body, subject to HTTP method/framing rules.
Type: (string \| buffer)?. Read/write field.
TimeoutMs
Section titled “TimeoutMs”Per-request deadline in milliseconds, within runtime limits.
Type: number?. Read/write field.
MaxResponseBytes
Section titled “MaxResponseBytes”Maximum accepted response body size in bytes, within runtime limits.
Type: number?. Read/write field.
Full type declaration — for type checking and deeper reference
The declaration is generated from the SDK. Self is supplied by a colon call; read means the field cannot be assigned. See how to read this reference.
export type HttpRequestOptions = { Url: string, Method: string?, Headers: {HttpHeader}?, Body: (string | buffer)?, TimeoutMs: number?, MaxResponseBytes: number?,}Availability and deeper reading
Section titled “Availability and deeper reading”See platform limits before relying on host-specific behavior. The framework design specification and reflection/type sources are deeper engineering references, not extra setup required to build an app.