http

Request functions, this functions will only work when the unsafe script functionality is turned on

http.get

http.get(url): string

Argument

Type

Description

url

String

URL to request to

Returns the response of the website

http.get_async

http.get_async(url, method)

Argument

Type

Description

url

String

URL to request to

method

Table

Table containing the method that will be ran once the request is completed

This method wont hang the game while the request doesnt have a response

http.get_async("https://google.com", {
  run = function(text)
        client.print(text)
  end
})

http.post

http.post(url): string

Argument

Type

Description

url

String

URL to request to, containing parameters

Returns the response of the website

http.post_async

http.post_async(url, method)

Argument

Type

Description

url

String

URL to request to, containing parameters

method

Table

Table containing the method that will be ran once the request is completed

This method wont hang the game while the request doesnt have a response

http.post_async("https://google.com", {
  run = function(text)
        client.print(text)
  end
})

http.load

http.load(url): <?>

Argument

Type

Description

url

String

URL where the Lua code is

This method will load the code inside the specified URL into the script context

json = (http.load("http://regex.info/code/JSON.lua")())

Last updated