Request. asp
Dim https Set HTTPS = server. Createobject ("msxml2.xmlhttp ") 'Define an XMLHTTP object HTTPS. Open "Post", "http: // 127.0.0.1/testpost/response. asp", false HTTPS. Send "Echo 123456 987654 11111 22222" If HTTPS. readystate = 4 then Response. Write "submitted successfully" 'Readstate reading status is 4, and the operation is successful. If the reading status is not successful, you do not need to proceed. Dim objstream Set objstream = server. Createobject ("ADODB. Stream ") 'Define a stream. You have to deal with it because it is garbled. Objstream. type = 1 Objstream. mode = 3 Objstream. Open Objstream. Write HTTPS. responsebody Objstream. Position = 0 Objstream. type = 2 Objstream. charset = "gb2312" Html = objstream. readtext 'Convert the code and put it in HTML to close these images. Objstream. Close Set objstream = nothing Set HTTPS = nothing End if Response. Write html Response. asp 'Create a domdocument object Set xml = server. Createobject ("msxml2.domdocument ") XML. async = false 'Load Post Data XML. Load request If XML. parseerror. errorcode <> 0 then Response. Write "cannot receive data correctly" & "Description:" & xml. parseerror. Reason & "<br> line:" & xml. parseerror. Line End if Set blogchild = xml. getelementsbytagname ("misc_command ") 'The _ text = blogchild. Item (0). childnodes (1). Text 'The _ text = blogchild. Item (0). Text 'For I = 0 to blogchild. Length-1 Response. Write the_text |
Using this method, it is easy to call servlet or Web Service in ASP!