我想向 https://auth.roblox.com/v1/authentication-ticket 提出请求,引用者为 https://www.roblox.com/home。我如何将 referer 参数添加到获取请求中?
const cookie = "cookie";
const csrf = "assuming we have csrf ticket already";
const gticket = await fetch(
"https://auth.roblox.com/v1/authentication-ticket",
{
method: "POST",
headers: {
Cookie: ".ROBLOSECURITY=" + cookie,
"x-csrf-token": csrf,
},
referrer: "https://www.roblox.com/home"
}
);
const ticket = await gticket.text(); // error debugging
console.log(ticket);
我试过上面的代码,但没有用。请帮我解决这个问题。
{“错误”:[{“代码”:2,“消息”:“UrlReferrer 无效或来自 Roblox 外部。”,“userFacingMessage”:“出了点问题”}]}
您必须将此标头添加到请求中:
"Referer": "https://www.roblox.com/home"