HTTP GET Request, ASP - I'm lost!

前端 未结 2 1656
渐次进展
渐次进展 2020-12-02 00:16

Using VBScript with ASP I am trying to set up an HTTP GET Request which will visit a page which in turn generates a line of ASCII (non-HTML). I then want to extrapolate that

2条回答
  •  粉色の甜心
    2020-12-02 00:49

    Your code should look like this:-

    Function GetTextFromUrl(url)
    
      Dim oXMLHTTP
      Dim strStatusTest
    
      Set oXMLHTTP = CreateObject("MSXML2.ServerXMLHTTP.3.0")
    
      oXMLHTTP.Open "GET", url, False
      oXMLHTTP.Send
    
      If oXMLHTTP.Status = 200 Then
    
        GetTextFromUrl = oXMLHTTP.responseText
    
      End If
    
    End Function
    
    Dim sResult : sResult = GetTextFromUrl("http://www.certigo.com/demo/request.asp")
    

    Note use ServerXMLHTTP from within ASP, the XMLHTTP component is designed for client side usage and isn't safe to use in the multithreaded environment such as ASP.

提交回复
热议问题