带有Google AppScript的DailyMotion API的简单GET方法返回503错误。我在这里错了吗?

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

[每次我使用GET方法进行API调用时,都会返回503错误。我什至尝试添加一个生成的访问令牌以查看它会返回结果,但始终显示相同的错误。

但是,从Web浏览器调用时,相同的GET方法也可以正常工作。

详细的错误消息如下:[例外:https://api.dailymotion.com的请求失败,返回了代码503。服务器响应被截断:消失了。 (使用mutantHttpExceptions选项检查完整响应)(第24行,文件“ DailyMotion”)]

Screenshot of the error message

function dailymotionArtist() {
    var artistchannelID = 'x24dh63';
    var access_token = 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx';

    var requestOptions = {
        'headers': {
            'Authorization': 'Bearer ' + access_token
        },
        'muteHttpExceptions': true,
        //'followRedirects': false,
        method: 'GET'
    }

    var finalResponse2 = UrlFetchApp.fetch('https://api.dailymotion.com/user/' + artistchannelID + '?fields=followers_total%2Cviews_total', requestOptions);

    Logger.log(finalResponse2.getContentText());


}
javascript google-apps-script urlfetch dailymotion-api
1个回答
0
投票

503错误消息通常表示服务器暂时无法响应请求,通常不表示错误请求-请参见description of the 503 code

我总是建议尝试使用Postman或其他HTTP客户端尝试请求以测试API并非只是在调试503代码之前暂时关闭。

© www.soinside.com 2019 - 2024. All rights reserved.