HTTP GET Request, ASP - I'm lost!

前端 未结 2 1645
渐次进展
渐次进展 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:41

    Try changing the oXMLHTTP.responseBody to oXMLHTTP.responseText and see if that works.

    Refer to this web page if you need some more information on this technique:

    http://classicasp.aspfaq.com/general/how-do-i-read-the-contents-of-a-remote-web-page.html.

    0 讨论(0)
  • 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.

    0 讨论(0)
提交回复
热议问题