GET request data doesn't update

后端 未结 2 1680
故里飘歌
故里飘歌 2021-01-15 02:35

I\'m trying to retrieve data from an API but my variable doesn\'t update even if I set it as nothing before the GET request.

The data of the variable update only if

2条回答
  •  北荒
    北荒 (楼主)
    2021-01-15 03:33

    This is for diagnostic purposes.

    On Error Resume Next
    Set File = WScript.CreateObject("Msxml2.XMLHTTP.6.0")
    File.Open "GET", "https://www.google.com.au/search?q=cat", False
    File.setRequestHeader "User-Agent", "Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.0; Trident/4.0; SLCC1; .NET CLR 2.0.50727; Media Center PC 5.0; .NET CLR 1.1.4322; .NET CLR 3.5.30729; .NET CLR 3.0.30618; .NET4.0C; .NET4.0E; BCD2000; BCD2000)"
    File.Send
    
    wscript.echo "==================" 
        wscript.echo "" 
        wscript.echo "Error " & err.number & "(0x" & hex(err.number) & ") " & err.description 
        wscript.echo "Source " & err.source 
        wscript.echo "" 
        wscript.echo "Server Response " & File.Status & " " & File.StatusText
        wscript.echo    File.getAllResponseHeaders
        wscript.echo    File.ResponseBody
    

提交回复
热议问题