XMLHTTP technical information

xiaoxiao2021-04-05  241

XMLHTTP Application Reference First, Use Steps: 1, create an XMLHTTP object // Require MSXML 4.0 Support 2, open the connection with the server, and define instruction sending mode, service web page (URL), and request permission. The client opens the connection to the server's service web page via the Open command. Like the ordinary HTTP instruction, you can point to the server's service web page with the "GET" method or "post" method. 3, send the instruction. 4, waiting and receive the processing result returned by the server. 5. Release the XMLHTTP object II, XMLHTTP method: Open (BStrMethod, BStrull, Varasync, BStruser, BStrPassword) BSTRMETHOD: Data transfer mode, GET or POST. BSTRURL: The URL of the service web page. Varasync: Whether to perform synchronously. The default is true, ie synchronous execution, but can only implement synchronous execution in the DOM. It is generally set to False, which is performed asynchronously. BSTRUSER: User name, can be omitted. BSTRPASSWORD: User password, can be omitted. Send (Varbody) Varbody: Instruction Set. Can be XML format data, or a string, stream, or an unsigned integer array. It can also be omitted, and the instruction will be submitted through the URL parameter of the OPEN method. SetRequestHeader (BSTRHEADER, BSTRVALUE) BSTRHEADER: http header BSTRVALUE: HTTP header (header) value

If the Open method is defined as POST, you can define a form-up upload: XMLHTTP.SetRequestHeader ("Content-Type", "Application / X-WWW-FORM-URLENCODED") 3, XMLHTTP Property: OnReadyStateChange: Get the return result in synchronous execution mode Event handle. Can only be called in the DOM. ResponseBody: Results Returns to an unregulated integer array. ResponseStream: The result is returned to the ISTREAM stream. ResponseText: The result is returned to a string. Responsexml: The result is returned to XML format data.

转载请注明原文地址:https://www.9cbs.com/read-132122.html

New Post(0)