【发布时间】:2020-06-12 07:47:05
【问题描述】:
我正在使用 twitch 的 API。
-
我已经在 postman 上检查了 API 的工作是否正常
- 抽搐 API => https://api.twitch.tv/helix/users/follows?to_id=TWITCH_ID_IS_HERE&first=100
- 标头 => 客户端 ID:CLIENT-ID-IS-HERE
-
我在我的 angular 8 项目上测试了另一个 API 仍然可以正常工作。
例子
{ _total: 35, 视频: Array(10) }
zone.js:3372 XHR finished loading: GET"https://api.twitch.tv/kraken/channels/TWITCH_ID_IS_HERE/videos".
4.这是从损坏的服务 API 返回的数据集
- 抽搐 API => https://api.twitch.tv/helix/users/follows?to_id=TWITCH_ID_IS_HERE&first=100
- 标头 => 客户端 ID:CLIENT-ID-IS-HERE
body: {
error: "'users' with id='follows' not found"
},
url: "https://api.twitch.tv/helix/users/follows?
to_id=TWITCH_ID_IS_HERE&first=100",
headers: HttpHeaders,
status: 404,
statusText: "Not Found"
}
5.服务功能
async getUserFollows(twitchId) {
return new Promise((resolve, reject) => {
this.http.get('https://api.twitch.tv/helix/users/follows', {
headers: new HttpHeaders({
'Client-ID': this.clientId
}), params: new HttpParams()
.set('to_id', twitchId)
.set('first', '100')
}).subscribe(
(res: any) => {
resolve(res);
}, err => {
reject(err);
}
);
}
);
}
我该怎么办?我错过了什么?
【问题讨论】:
-
您在浏览器的“网络”选项卡中有什么,您觉得这个请求不错吗?
-
我没有找到任何请求的“api.twitch.tv/helix/users/follows”网络标签,最后一个请求是第 3 条的另一个功能。
-
我请求 3 服务 1.channel desc 2.stream 3.follower 我在网络流量上只找到了 1、2 但没有找到 3。