已回答:
X-Upload-Content-Length
值中有一个空格。
问题:
我想使用Youtube API从C ++桌面应用程序上传视频。我实现了Resumable Upload,一切都在下午19/07周五工作,我可以上传几个小视频,从那以后我总是在使用我的应用时出错:“503:服务不可用”。< / p>
我找到了几个主题来处理这个话题,似乎有两个解决方案:
一次又一次地做同样的请求并没有为我解决(我试图连续5次做请求,也许我应该做更多请求?多少?)。这是一个示例请求和我得到的响应:
请求:
POST https://www.googleapis.com/upload/youtube/v3/videos?uploadType=resumable&part=snippet HTTP/1.1
Accept: */*
Accept-Language: xx
Authorization: Bearer MY_ACCESS_KEY
X-GData-Key: key=MY_DEV_KEY
Content-Type: application/json
X-Upload-Content-Type: video/avi
X-Upload-Content-Length: 302 080
User-Agent: SOME_PRIVATE_STUFF
Host: www.googleapis.com
Content-Length: 167
Connection: Keep-Alive
Cache-Control: no-cache
{
"snippet": {
"title": "My video title",
"description": "This is a description of my video",
"tags": ["cool", "video", "more keywords"],
"categoryId": 22
}
}
回应:
HTTP/1.1 503 Service Unavailable
Date: Fri, 26 Jul 2013 16:33:27 GMT
Server: HTTP Upload Server Built on Jul 21 2013 19:20:38 (1374459638)
Content-Length: 0
Content-Type: text/html; charset=UTF-8
感谢您的帮助,我现在真的不知道该怎么做。