我尝试使用AngularJS应用中的Youtube API V3更新视频元数据。我可以使用插入上传视频。400使用AngularJS进行Youtube API更新的错误请求
我试图在上传的同时设置视频元数据时遇到了无限的问题,并且确定这种情况不会发生,除非任何人都能以不同的方式告诉我。另一种方法是使用api https://developers.google.com/youtube/v3/docs/videos/update的视频更新操作设置元数据。
我recieving 400(错误请求)
{
"error": {
"errors": [
{
"domain": "global",
"reason": "badContent",
"message": "Unsupported content with type: application/json;charset=UTF-8"
}
],
"code": 400,
"message": "Unsupported content with type: application/json;charset=UTF-8"
}
}
我的继承人$ HTTP请求
$http({
method: "PUT",
url: "https://www.googleapis.com/upload/youtube/v3/videos?part=snippet,id",
headers: {
Authorization: 'Bearer ' + my_google_token
},
data: {
id: "my_video_id",
snippet: {
title: "my video title",
description: "my video description",
tags: ['my','videos','tags'],
categoryId: '17'
}
}
}).then(function(response){
console.log('success');
},function(error){
console.log(error);
});
您是否曾经弄清楚如何在原始POST上载中设置片段?我有类似的问题..我的上传工作正常,但它从来没有实际设置片段的标题和说明。 – user3344977