How To Submit Form Data by Using XMLHTTP or ServerXMLHTTP Object
来源:互联网 发布:电力系统潮流计算算法 编辑:程序博客网 时间:2024/05/16 12:30
How To Submit Form Data by Using XMLHTTP or ServerXMLHTTP Object
Article ID | : | 290591 |
Last Review | : | July 13, 2004 |
Revision | : | 1.0 |
This article was previously published under Q290591
On this page
SUMMARY | ||
MORE INFORMATION | ||
REFERENCES |
SUMMARY
In some cases, you may want to send data to a port or server so that you can use the Form collection on the Request object in the page or listening application. To do this, you need to add headers to notify the receiver that the body contains data that can be accessed from the Form collection.
MORE INFORMATION
Requests that are being sent are based on two parts: the Header and the Body. The Header contains information about the Body so that the receiver knows what data is contained there.
When you use just the XMLHTTP object from client-side script, the same header information and data format must be observed.
Header Information
The Header information that needs to be set is the Content-Type. In this case, set this to the value of application/x-www-form-urlencoded.Body Data
The Body contains the data that you want to send. The data takes the shape of name=value. For multiple values, you can use the "&" symbol to separate each name-value pair. For example:input1=Hello&input2=World&idValue=12345
The receiver is able to pick the values "Hello," "World," and "12345" by using the names "input1," "input2," and "idValue" respectively. Step-by-Step Instruction for ServerXMLHTTP Object
1. | Ensure that the server has MSXML 3.0 or later parser, that the Proxy Configuration Utility has been run, and that the settings have been configured. For more information, see the "References" section of this article. |
2. | Copy the following code into a new Active Server Pages (ASP) page called ServerHTTP.asp. Place the ASP page in the default Home directory. NOTE: The two ASPs should be in different virtual folders due to threading issues.If pooling is set to Low or Medium (this is the default for Microsoft Windows 2000), you should POST to an ASP in a different virtual folder. If the ASP is in the same virtual folder, the ASP stops responding (hangs). After you close the browser, that ASP and other ASPs continue to hang because the request stays queued even though you close the browser. You must restart IIS or restart the computer. If you change the pooling to High, you can run the code to the remote ASP again because you are using a new thread. |
3. | Copy the following code into a new ASP page called Receiver.asp. Place the ASP page in the default Home directory. When Posting, be sure that you use the name of the server, not Localhost, and that the URL that is being opened by the XMLHttp, should also contain the same server name. |
4. | Ensure that the "POST" is pointing to the correct location. |
5. | Click the Submit XMLHTTP button. |
Step-by-Step Instruction for XMLHTTP Object
1. | Copy the following code into a new ASP page called ClientHTTP.asp. Place the ASP page in the default Home directory.
|
2. | Create the page from step 3 of the ServerXMLHTTP steps outlined previously. |
3. | Ensure that the "POST" is pointing to the correct location. |
4. | Load the ClientHTTP.asp in a browser |
REFERENCES
For additional information, click the article number below to view the article in the Microsoft Knowledge Base:
289481 How To Proxy Configuration Utility Must Be Run for ServerXMLHTTP to Work
APPLIES TO
• | Microsoft XML Parser 3.0 Service Pack 3 |
• | Microsoft XML Parser 3.0 Service Pack 1 |
• | Microsoft XML 4.0 |
Keywords: | kbhowto KB290591 |
- How To Submit Form Data by Using XMLHTTP or ServerXMLHTTP Object
- How to Submit a Form Using JavaScript
- How to use insert or retrieve data by using Core Data in iOS
- How to transfer data to an Excel workbook by using Visual C# 2005 or Visual C# .NET
- How to simulate a Form POST request by using WinInet
- How to simulate a Form POST request by using WinInet
- How to simulate a Form POST request by using WinInet
- HOW TO: Transfer Data to an Excel Workbook by Using Visual Basic .NET
- How To Transfer XML Data to Microsoft Excel 2002 by Using Visual C# .NET
- How to send raw data to a printer by using Visual C# .NET
- How to show 3D object (.3DS or .MAX) in MATLAB using JMonkey
- How to use an Outlook Object Model from Visual C++ by using a #import statement
- How To Display Hierarchical Data by Using Nested Repeater Controls and Visual C# .NET
- How To Read and Write BLOB Data by Using ADO.NET with Visual C# .NET
- How to provide an alternative view of data by using a splitter window
- How To Display Hierarchical Data by Using Nested Repeater Controls and Visual
- How To Read and Write BLOB Data by Using ADO.NET with Visual C# .NET
- How to Submit a Form with Control + Enter
- C++ Boost graph库 广度优先遍历算法示例
- test
- 厌倦了闪动的页面?来试试 javascript+WebService 吧!
- 打印出所有该目录下的文件和文件夹
- 如何考核测试人员?
- How To Submit Form Data by Using XMLHTTP or ServerXMLHTTP Object
- JAVA文件加密器(收藏)
- 使用xmlhttp为网站增加域名查询功能
- 用ant来管理项目
- Javascript 调用XML制作连动下拉框
- 补充 宝玉 之《URL欺骗之以假乱真!》之 POST 方法提交数据 之 处理!
- 演讲技巧
- 一个简单的XML Schema的例子
- 02.24.2005 林大单一打球日记