Simulate a Form POST Request Using WinInet
2001-11-22 01:27
351 查看
这是MSDN中的一篇文章,说的是用WinInet来模拟表单的发送,用的是VC及SDK两种方法实现的,用文中方法便可以实现直接将表单发送到WEB服务器上了,比直接在网页上填表高明多了。原文较短且很简单,就没翻译,直接帖上来了,没弄明白MSDN中的算转帖还是算收藏,反正哪位仁兄能用上就行了HOWTO: Simulate a Form POST Request Using WinInetLast reviewed: February 10, 1998Article ID: Q165298 |
The information in this article applies to: The Microsoft Foundation Classes (MFC) included with: - Microsoft Visual C++, 32-bit Editions, versions 4.2, 5.0 Microsoft Internet Client SDK, versions 4.0, 4.01 SUMMARYTo properly simulate a Form submission using WinInet, you need to send a header that indicates the proper Content-Type. For Forms, the proper Content-Type header is:MORE INFORMATIONIn many cases, the server does not respond appropriately if a Content-Type is not specified. For example, the Active Server Pages component of IIS 3.0 actually checks this header specifically for 'application/x-www-form- urlencoded' before adding form variables to the "Request.Form" object. This MIME/Content-Type indicates that the data of the request is a list of URL- encoded form variables. URL-encoding means that space character (ASCII 32) is encoded as '+', special character such '!' encoded in hexadecemal form as '%21'.Here is a snippet of code that uses the MFC WinInet classes to simulate a Form POST request: Without MFC, the same code translates to straight SDK calls as follows: REFERENCESFor more information on URL-encoding and the format of a Form POST request, see section 8.2 in RFC 1866. |
相关文章推荐
- 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
- [Project] Simulate HTTP Post Request to obtain data from Web Page by using Python Scrapy Framework
- [Project] Simulate HTTP Post Request to obtain data from Web Page by using Python Scrapy Framework
- [Project] Simulate HTTP Post Request to obtain data from Web Page by using Python Scrapy Framework
- GET和POST(ajax request, form submit, 上传文件)
- Request.Form接收不到post数据.
- POST请求中参数以form data和request payload形式+清空数组方式
- AJAX POST请求中参数以form data和request payload形式在servlet中的获取方式
- How to POST Form Data Using Ruby(转)
- post提交方式,get提交方式,context.Request.QueryString["key"],context.Request.Form["key"],context.Request.Params["key"],context.Request.["key"]
- application/x-www-form-urlencoded 的contentType,POST数据内容过大,导致tomcat的request取不到参数
- HTTP AJAX POST请求中参数以form data和request payload形式在servlet中的获取方式
- vue axios POST请求中参数以form data和request payload形式的原因
- AJAX POST请求中参数以form data和request payload形式在servlet中的获取方式
- C#中HttpWebRequest用Post提交Content-Type: multipart/form-data; boundary=
- Servlet获取AJAX POST请求中参数以form data和request payload形式传输的方法
- simulate POST request
- ASP.NET中Get和Post的用法 Request.QueryString,Request.Form,Request.Params的区别 [转]