---
title: HTTP
nav_order: 9
---

# HTTP

Runs from the cheat process (WinHTTP), not Roblox HttpService permissions.

## request / http_request

```lua
function request(options: {
    Url: string,
    Method: string?,
    Body: string?,
    Headers: { [string]: string }?,
}): {
    Success: boolean,
    StatusCode: number,
    Body: string,
    StatusMessage: string,
    Headers: { [string]: string },  -- currently empty table
}
```

`http_request` is the same function.

```lua
local r = request({
    Url = "https://example.com",
    Method = "GET",
})
if r.Success then
    print(#r.Body)
end
```

## HttpGet

```lua
function HttpGet(url: string): string
```

Errors on non-2xx / failure (use `pcall`).

## HttpService

```lua
HttpService:GetAsync(url): string
HttpService:RequestAsync(options)  -- same shape as request
HttpService:JSONEncode(value): string
HttpService:JSONDecode(json): any
```

### JSON limits

Encode/decode: `nil`, bool, number, string only. Tables encode as `"null"`. Not a full JSON library.
