url to make a request to.
RequestType indicating if this request is a POST or GET request.
OptionalqueryParams: []parameters to include at the end of the URL.
Optionalheader: []table of key-values to add to the header of the request.
Optionalcallback: Functioncallback to run after the request is completed.
OptionaldataType: BodyTypeBodyType for the provided body data.
Optionalbody: []table of key-values to be passsed into the body of the request.
osrs.HTTP.request(
WEB_URL,
osrs.HTTP.RequestType.GET,
{},
{},
function(responseData, responseType, responseCode)
osrs.print("Response code: " .. tostring(responseCode))
osrs.print("Response type: " .. tostring(responseType))
osrs.print("Response data: " .. tostring(responseData))
end,
osrs.HTTP.BodyType.NONE,
{}
)
Function for handling making a GET or POST HTTP request, with specifiable parameters and types.