I’m trying to delete videos using the YouTube API v2. I’ve been able to upload videos so I believe I’m constructing the requests properly but am having trouble deleting an uploaded video. When I send in the request, I get the following error:
400: Bad Request
GDataParseException
Premature end of file.
This is what I’m sending via the 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("")
I’m using the docs for reference and I tried searching but was unable to find something useful so I don’t know what I’m missing.
Any hints/clues/etc, would be much appreciated! Thanks in advance!
According to the given example:
Request call should be as follows: