我試圖通過C#中的API(不通過客戶端)將視頻(可恢復)上傳到YouTube。YouTube API視頻上傳解析錯誤C#
我下面these instructions on using resumable upload protocol
然而,當我這樣的嘗試,我回去瞭解析錯誤。
這裏是我的要求:
POST /upload/youtube/v3/videos?uploadType=resumable&part=snippet,status,contentDetails&key={api_key} HTTP/1.1
Host: www.googleapis.com
X-upload-content-length: 5346742
X-upload-content-type: video/*
Content-type: application/json; charset=UTF-8
Content-length: 277
Authorization: Bearer {access_token}
{
"snippet": {
"title": "My video title",
"description": "This is a description of my video",
"tags": ["cool", "video", "more keywords"],
"categoryId": 22
},
"status": {
"privacyStatus": "public",
"embeddable": True,
"license": "youtube"
}
}
這裏是迴應:
HTTP/1.1 400 Bad Request
Alternate-protocol: 443:quic
Content-length: 171
Via: HTTP/1.1 GWA
X-google-cache-control: remote-fetch
Server: HTTP Upload Server Built on Sep 30 2013 10:58:35 (1380563915)
Date: Wed, 02 Oct 2013 21:38:10 GMT
Content-type: application/json
{
"error": {
"errors": [
{
"domain": "global",
"reason": "parseError",
"message": "Parse Error"
}
],
"code": 400,
"message": "Parse Error"
}
}
人有什麼想法?
ArgeKumandan,我寧願不使用beta sdk。同樣在你給它的例子中,我需要知道用戶名和密碼。我有一個有效的OAuth2令牌,但沒有用戶名/密碼。如果沒有辦法讓瀏覽器方法工作,我會使用.NET SDK。 –