vb6发送带cookie的get请求

版权声明:本文为博主原创文章,欢迎注明出处转载 https://blog.csdn.net/shepherd_dirk/article/details/84645734
Private Function HttpGet(ByVal URL As String, ByVal Cookie As String) As String
    Dim HTTP As Object
    
    Set HTTP = CreateObject("Msxml2.ServerXMLHTTP.6.0")
    HTTP.open "GET", URL, False
    HTTP.SetRequestHeader "Cookie", Cookie
    
    HTTP.send
    
    HttpGet = HTTP.responseText
    
    'Debug.Print HttpGet
End Function

带cookie发送http请求要用Msxml2.ServerXMLHTTP,使用Msxml2.XMLHTTP没有效果

参考:
VBS发送带Cookie的HTTP请求

猜你喜欢

转载自blog.csdn.net/shepherd_dirk/article/details/84645734