Overview
Request Master is a full-featured toolkit for using http_request()
to its potential. Send HTTP requests with parameters already encoded for you, instead of manually escaping them and building query strings. The included request helpers also enable handling the response using a callback instead of a separate Async HTTP event.
Features
application/x-www-form-urlencoded
, multipart/form-data
and application/json
formatsDocumentation
See the Wiki section on the official GitHub repository.
Example
Accessing Steam API:
xhr_get("https://api.steampowered.com/ISteamNews/GetNewsForApp/v2/", {
params: { appid: 282800, count: 1 },
done: function(res) {
show_message("Latest news from 100% Orange Juice: " + res.data.appnews.newsitems[0].title);
},
fail: function() {
show_message("Can't fetch headlines from Steam.");
}
});
Downloading a file:
xhr_download("http://web.archive.org/web/20060821000040im_/http://gamemaker.nl/images/header.jpg", working_directory + "gmlegacy.jpg", {
done: function(res) {
sprite_index = sprite_add(res.file, 1, false, false, 0, 0);
},
fail: function(res) {
show_message_async("Failed to download the image!");
}
});
End User Licence Agreement (EULA).
v1.2.2 - Opera GX Maintenance Release