【发布时间】:2014-01-26 19:01:55
【问题描述】:
问题很简单,我无法向 youtube api video.update 发出非常简单的请求,而不会收到 400 响应,原因是“invalidRequest”。我正在使用 Youtube API Explorer (https://developers.google.com/youtube/v3/docs/videos/update)。该帐户已授权。其他 API 方法,例如 playlists.update 和 videos.list 也可以正常工作。请帮忙处理这个 video.update 请求。
已发送测试请求:
PUT https://www.googleapis.com/youtube/v3/videos?part=snippet&key={YOUR_API_KEY}
Content-Type: application/json
Authorization: Bearer {AUTH_KEY}
X-JavaScript-User-Agent: Google APIs Explorer
{
"id": "{VIDEO_ID}",
"snippet": {
"title": "title change to test1",
"description": "description change to test"
}
}
收到的回复:
400 Bad Request
- Hide headers -
cache-control: private, max-age=0
content-encoding: gzip
content-length: 134
content-type: application/json; charset=UTF-8
date: Sun, 26 Jan 2014 18:48:13 GMT
expires: Sun, 26 Jan 2014 18:48:13 GMT
server: GSE
{
"error": {
"errors": [
{
"domain": "youtube.video",
"reason": "invalidRequest",
"message": "Bad Request"
}
],
"code": 400,
"message": "Bad Request"
}
}
【问题讨论】:
标签: youtube-api http-status-code-400