Open Asterune
HttpService

HttpService

Server-side HTTP requests.

Service
game:GetService("HttpService")
Inherits
Instance
Replication
Never

Behavior

HttpService sends HTTP requests from server scripts. JSON serialization is provided by the global json library.

Summary

Members5
Properties1
Methods4

Properties

HttpEnabled

HttpService.HttpEnabled: boolean

Whether scripts are allowed to make HTTP requests.

Methods

GenerateGUID

HttpService:GenerateGUID(wrap: boolean?): string

Returns a generated globally unique identifier.

GetExecutionGroup

HttpService:GetExecutionGroup(): ExecutionGroup?

Returns this instance if it is an ExecutionGroup. Otherwise returns the nearest ancestor ExecutionGroup, or nil when no group contains the instance.

Request

HttpService:Request(options: HttpRequestOptions): HttpResponse

Sends an HTTP request described by a table and returns a response table. The operation is server-only and yields while the request is in progress.

UrlEncode

HttpService:UrlEncode(input: string): string

Encodes a string for use in a URL.

Inherited members

Inherited47

Example

Luau
local HttpService = game:GetService("HttpService")
local response = HttpService:Request({
  Url = "https://example.invalid",
  Method = "GET",
})
print(response.StatusCode)

json