Dota 2 API“Uncaught SyntaxError:Unexpected token”

时间:2017-04-04 15:28:56

标签: javascript angularjs api jsonp token

vm.getDotaApi = function () {
        var url = "https://api.steampowered.com/IDOTA2Match_570/GetLeagueListing/v1/";
        $http({
            method: 'JSONP',
            url: url,
            dataType: 'json',
            responseType: "json",
            callback: 'JSON_CALLBACK',
            params: {
                key: 'my_key*********',
            }
        }).
        success(function (response) {
        }).
        error(function (data, status, headers, config) {
        });
    }

我尝试使用http请求从Dota 2获取数据。我在我的项目中使用AngularJS。 发送http请求后,我可以在控制台中看到错误:

"Uncaught SyntaxError: Unexpected token :".

在“预览”中,我获得了一些数据,但我无法使用这些

Image

请求状态为200

Image

我知道这个问题已被提出,但我无法找到解决方案来修复我的程序。

0 个答案:

没有答案
相关问题