我嘗試使用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