XMLHTTP obtains web access header information and sample code analysis of web pages

Source: Internet
Author: User
This article describes how to use XMLHTTP to obtain the web access header information and analyze the sample code of the web page. it has some reference value. let's take a look at it. XMLHTTP obtains web access header information and sample code analysis of web pages

<% Function BytesToBstr (body, Cset) dim objstream set objstream = Server. createObject ("adodb. stream ") objstream. type = 1 objstream. mode = 3 objstream. openobjstream. write body objstream. position = 0 objstream. type = 2 objstream. charset = Cset BytesToBstr = objstream. readText objstream. close set objstream = nothingEnd Function url = request. form ("url") if trim (url) <> "then set xml = Server. createObject ("MSXML2.XMLHTTP. 5.0 ") xml. open "GET", url, False xml. send bo = BytesToBstr (xml. responseBody, "UTF-8") header = xml. getAllResponseHeaders set xml = nothingend if %>   XMLHTTP test
       

  

                                                     
       <% = Header %>
       <% = Bo %>

     

The above is the details of XMLHTTP's web access header information and webpage sample code analysis. For more information, see other related articles in the first PHP community!

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.