如何获取某人的 CS2 库存作为 JSON 对象?

问题描述 投票:0回答:1

我试图从 CS2 获取某人的个人资料库存,但不断遇到 403 错误。我需要在哪里放置 API 密钥吗?

try {
            URL url = new URL("https://steamcommunity.com/profiles/"+ steamID+ "/inventory/json/730/2");
            HttpURLConnection conn = (HttpURLConnection) url.openConnection();
            conn.setRequestMethod("GET");
            int statusCode = conn.getResponseCode();

            if(statusCode != HttpURLConnection.HTTP_OK) {
                throw new IOException("Received non-OK response from server");
            }
 } ...

当我通过浏览正常访问该链接时,没有问题。

java http-status-code-403 steam
1个回答
0
投票

Öğrenci Gündemi, öğrencilere yönelik kapsamlı bilgi paylaşımları sunar。 KPSS、YKS、LGS'den çıkmış sorular, ders notları ve daha fazlası için doğru adres.

https://ogrencigundemi.com/

最新问题
© www.soinside.com 2019 - 2025. All rights reserved.