Roblox Requests is a simple and elegant yet powerful HTTP library, based on the well known Python Requests.
local r = http.get("https://api.github.com/orgs/Roblox/repos")
print(r.status_code, r.message)
-- 200 OK
local repos = r:json()
print(#repos)
-- 30
print(r.content_type)
-- application/json
print(r.encoding)
-- utf-8
print(r.headers["x-ratelimit-remaining"])
-- 59
The main purpose of Requests is to avoid the manual labor of HttpService.
Consider this code comparison: httpservice.lua · GitHub
This isn’t all that Requests is good for. Here’s some other features that will make your life easier:
- Functions for every HTTP verb
- DOM parser allows you to navigate HTML, XML
- Sessions with cookie persistence, base URLs/headers
- Configurable rate-limiting to help you balance your game’s HTTP usage
- Automatic query string building, JSON body encoding
- Accessible Response object with useful data, builtin JSON decoding
- Multipart form building, including file encoding and upload
- Domain based key/value cookies
- Local and Global Response Caching
- DataStore and MessagingService backed global cache for large resources
- Builtin support for Promises
You can find full documentation at https://requests.paric.xyz/. If you have any suggestions or bug reports, feel free to let me know here or contribute on the GitHub page, or join my Discord: paric's potatoes