[英]How to get CSGO Inventory with Steam API using jsonp?
So I'm trying to get a player's CSGO inventory using Valve's API, but I can't get it to work since it's giving me the no 'access-control-allow-origin' header is present on the requested resource.
因此,我试图使用Valve的API获取玩家的CSGO库存,但由于它使我no 'access-control-allow-origin' header is present on the requested resource.
因此无法正常工作no 'access-control-allow-origin' header is present on the requested resource.
error, so I tried using jsonp but I'm not sure if it supports it. 错误,因此我尝试使用jsonp,但不确定它是否支持它。 So I was wondering how I would get someone's inventory? 所以我想知道如何获取某人的库存? A ton of other sites can get it but I don't know what I need to do. 很多其他站点都可以得到它,但是我不知道该怎么做。 Any help is appreciated :) 任何帮助表示赞赏:)
I'm using javascript/jQuery if that helps at all 我正在使用javascript / jQuery,如果有帮助的话
You cant get access to the inventory via jsonp because steam disallows CORS requests (they need to set the headers). 您无法通过jsonp访问清单,因为Steam不允许CORS请求(它们需要设置标头)。
Since steam is not providing an option to enable this you need to proxy the inventory request through your own server. 由于Steam没有提供启用此功能的选项,因此您需要通过自己的服务器代理库存请求。
So you need to write your own REST API Proxy to achieve this: 因此,您需要编写自己的REST API代理来实现此目的:
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.