我正在尝试使用 YouTube API v2 删除视频。我已经能够上传视频,所以我相信我正在正确构建请求,但在删除上传的视频时遇到了麻烦。当我发送请求时,我收到以下错误:
400: Bad Request
GDataParseException
Premature end of file.
这是我通过 API 发送的内容:
Call objXMLHttp.open("PUT", "https://gdata.youtube.com/feeds/api/users/" & strYTUser & "/uploads/" & strVideoID, False)
Call objXMLHttp.setRequestHeader("DELETE", "/feeds/api/users/" & strYTUser & "/uploads/" & strVideoID & " HTTP/1.1")
Call objXMLHttp.setRequestHeader("Host", "gdata.youtube.com")
Call objXMLHttp.setRequestHeader("Authorization", "Bearer " & strAccessToken)
Call objXMLHttp.setRequestHeader("GData-Version", 2)
Call objXMLHttp.setRequestHeader("X-GData-Key", "key=" & strDevKey)
' Call objXMLHttp.setRequestHeader("Content-Length", 0)
Call objXMLHttp.setRequestHeader("Content-Type", "application/atom+xml; charset=UTF-8")
Call objXMLHttp.Send("")
我正在使用文档作为参考,我尝试搜索但找不到有用的东西,所以我不知道我错过了什么。
任何提示/线索/等,将不胜感激!提前致谢!