如何在youtube API v3中通过经典asp传递xmlHttp

时间:2018-04-02 06:40:23

标签: asp.net

function B

如果xmlHttp.Status> = 400并且xmlHttp.Status< = 599那么     Response.Write“
发生错误:”& xmlHttp.statusText 到Response.End 结束如果

我写了那样的代码

但响应是404错误

Set xmlHttp = CreateObject("MSXML2.ServerXMLHTTP")
URLString = "https://www.googleapis.com"
Call xmlHttp.open("POST", URLString, False)
Call xmlHttp.setRequestHeader("POST", "/upload/youtube/v3/videos?uploadType=resumable&part=snippet%2status%2contentDetails HTTP/1.1")
Call xmlHttp.setRequestHeader("Host", "www.googleapis.com")
Call xmlHttp.setRequestHeader("Authorization", "Bearer "& ACCESS_TOKEN)
Call xmlHttp.setRequestHeader("Content-Length", Len(jsonString))
Call xmlHttp.setRequestHeader("Content-Type", "application/json; charset=UTF-8")
Call xmlHttp.setRequestHeader("X-Upload-Content-Length", 2000)
Call xmlHttp.setRequestHeader("X-Upload-Content-Type", "video/*")
Call xmlHttp.Send(jsonString)

这是正确的发布请求

我该怎么办?

0 个答案:

没有答案