因此,基本上,我的chrome扩展程序在我当前登录的网站上执行发布请求。我在网站的其中一个页面上进行了获取请求:
$.get('https://www.roblox.com/home',function(data)
数据中显示我已登录的证据,因为我可以看到其中一个元素显示了我的userId作为登录证据。
问题是,当我尝试对采购api进行发布请求以购买商品时,出现错误:
jquery-3.3.1.min.js:2 POST https://www.roblox.com/API/Item.ashx?rqtype=purchase&productID=229840030&expectedCurrency=1&expectedPrice=35&expectedSellerId=1&userAssetID 403 (Token Validation Failed)
这是我的代码:
$.post("https://www.roblox.com/API/Item.ashx?rqtype=purchase&productID=229840030&expectedCurrency=1&expectedPrice=35&expectedSellerId=1&userAssetID").done(function(){
alert('Bought!')
});
我的问题是为什么我会出现此错误?