[英]Can't figure out how to pass Steam Web API a Int64
The Steam Web API has a function for getting information on a published Workshop file called GetPublishedFileDetails . Steam Web API具有获取有关已发布的名为GetPublishedFileDetails的 Workshop文件的信息的功能。 It says I can make a request for multiple files, but I cannot figure out how to do this with Javascript. 它说我可以请求多个文件,但是我不知道如何使用Javascript来实现。 At the moment, I have to make multiple calls to the API, which seems unnecessary. 目前,我必须多次调用API,这似乎是不必要的。
I've tried sending it an array, strings, everything I can think of. 我试过向它发送一个数组,字符串以及所有我能想到的东西。
for (let index = 0; index < arrayOfAddonIds.length; index++) {
$.ajax({
type: 'POST',
url: 'https://api.steampowered.com/ISteamRemoteStorage/GetPublishedFileDetails/v1/',
data: {
'itemcount': 1,
'publishedfileids[0]': parseInt(arrayOfAddonIds[index]),
},
dataType: 'json',
}).done((data) => {
console.log()
populateAddonList(addon_data);
}).fail((err) => {
console.log(err);
}).always((data) => {
var addon = data.response.publishedfiledetails["0"];
if (addon.result == 1) {
for (let i = 0; i < Object.keys(data).length; i++) {
var addonObject = {
"title": addon.title,
"id": addon.publishedfileid
}
addon_data.push(addonObject);
}
}
});
}
Is there a way I could achieve this in one call to the API? 有没有一种方法可以通过一次调用API来实现?
This is also Electron app, maybe that opens up some possibilities. 这也是Electron应用程序,也许会带来一些可能性。
I guess that you have to do an array like this: 我猜你必须做一个这样的数组:
data: {
'itemcount': 3, // Increase itemcount
'publishedfileids[0]': ID0,
'publishedfileids[1]': ID1,
'publishedfileids[2]': ID2, // Add items accordingly
},
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.