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
Whether scripts are allowed to make HTTP requests.
Returns a generated globally unique identifier.
Returns this instance if it is an ExecutionGroup.
Sends an HTTP request described by a table and returns a response table.
Encodes a string for use in a URL.
Properties
HttpEnabled
HttpService.HttpEnabled: booleanWhether scripts are allowed to make HTTP requests.
Methods
GenerateGUID
HttpService:GenerateGUID(wrap: boolean?): stringReturns 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): HttpResponseSends 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): stringEncodes a string for use in a URL.
Inherited members
- Properties
- ArchivableClassNameNameParent
- Methods
- AddComponent()AddTag()ClearAllChildren()ClearTags()Clone()Destroy()FindFirstAncestor()FindFirstAncestorOfClass()FindFirstAncestorWhichIsA()FindFirstChild()FindFirstChildOfClass()FindFirstChildWhichIsA()FindFirstDescendant()GetAttribute()GetAttributeChangedSignal()GetAttributes()GetChildren()GetComponent()GetComponentChangedSignal()GetComponents()GetDebugId()GetDescendants()GetFullName()GetPropertyChangedSignal()GetReferencing()GetTags()HasComponent()HasTag()IsA()IsAncestorOf()IsDescendantOf()RemoveComponent()RemoveTag()SetAttribute()WaitForChild()
- Events
- AncestryChangedAttributeChangedChangedChildAddedChildRemovedDescendantAddedDescendantRemovingDestroying
Example
local HttpService = game:GetService("HttpService")
local response = HttpService:Request({
Url = "https://example.invalid",
Method = "GET",
})
print(response.StatusCode)