So I'm being adventurous in that I am making a website and a Discord API. The website works fine, but I've recently decided to convert my code from XMLHTTPREQUEST to https instead, as I felt like it saved space and was easier to work with.
I'm running into an issue when using the Roblox Web API though. I've got this script:
const https = require('https');
https.get("https://www.roblox.com/Game/LuaWebService/HandleSocialRequest.ashx?method=GetGroupRank&playerid=" + JSON.parse(RoVerResponse.toString()).Id + "&groupid=72321", (res) => { res.on('data', (RobloxRankResponse) => {
console.log(RobloxRankResponse.toString())
This ends up logging on my console a lot of backend roblox stuff. Not going into specifics as it was VERY long and really wouldn't help. Needless to say, it's not what I want.
When I use XML, it looked like this:
var XMLHttpRequest = require("xmlhttprequest").XMLHttpRequest;
var Http = new XMLHttpRequest();
const url = "https://www.roblox.com/Game/LuaWebService/HandleSocialRequest.ashx?method=GetGroupRank&playerid="
Http.open("GET", url + userId + "&groupid=" + groupId);
Http.send();
Http.onreadystatechange=(e)=>{
if (Http.readyState == 4) {
var data = Http.responseText
if (data.success != false) {
resolve({"Rank": data})
} else {
err()
}
}
}
})
Pretty simple. The only difference was that on XML I could use something that appears as
responseText
which is returned and has the data I want in it. Now, I cannot do that, and get a gigantic wall of text.
Does anyone know the difference between how XML and https work, and what I could do to not get a large wall of text logged, and get the group rank instead?
Thanks!
