Article ID: 177188 - Last Review: August 5, 2004 - Revision: 3.2 SAMPLE: Using HttpSendRequestEx for Large POST Requests
This article was previously published under Q177188 On This PageSUMMARY
This sample demonstrates proper usage of the HttpSendRequestEx function
introduced in the Internet Explorer 4.0 WinInet.dll and documented in the
Internet Client SDK.
The original HttpSendRequest function has a significant limitation: all the data for the request has to be provided in a single buffer when the function is called. This is often inconvenient, leads to poor performance in certain client applications, and may make it impossible to upload large amounts of data from client machines with limited memory. The new HttpSendRequestEx function allows a program to start a request, send out the data in small pieces as available, then end the request once all the data has been sent. Internet Explorer 4.0 must be installed on the computer in order for this function to work. The following file is available for download from the Microsoft Download Center: Hsrex.exe
(http://download.microsoft.com/download/ie4095/hsrex/1/win98/en-us/hsrex.exe)
For additional information about how to download Microsoft Support files, click the following article number to view the article in the Microsoft Knowledge Base:
119591
(http://support.microsoft.com/kb/119591/EN-US/
)
How to Obtain Microsoft Support Files from Online Services
Microsoft scanned this file for viruses. Microsoft used the most current virus-detection software that was available on the date that the file was posted. The file is stored on security-enhanced servers that help to prevent any unauthorized changes to the file.
MORE INFORMATION
Hsrex.exe is a self-extracting archive that contains BigPost.cpp (the code
for the demonstration program) and Readall.asp, an Active Server Pages
(ASP) script that will read all data sent in a POST request. Readall.asp is
provided as a sample target for BigPost, which can be used on Microsoft
Internet Information Server (IIS) versions that support ASP. For other Web
servers, you will need to provide a corresponding server script to read the
data.
To compile the program with Microsoft Visual C++ 5.0, follow these steps:
BigPost <Size> <Server> <Path>
For example, the following would POST 1 megabyte (1024KB) to
http://yourserver/scripts/ReadAll.asp:
BigPost 1024 yourserver /scripts/ReadAll.asp
The output from this would be as follows:
Test of POSTing 1024KB with WinInet 1048576 bytes sent. The following was returned by the server: 1048576 bytes were read. Finished. Notes
REFERENCES
For additional information, please see the following article in the
Microsoft Knowledge Base:
177190
(http://support.microsoft.com/kb/177190/EN-US/
)
BUG: Error 12019 When Calling InternetWriteFile
APPLIES TO
| Other Resources Other Support Sites
CommunityGet Help NowArticle Translations
|






Windows Live
Facebook
Twitter
Linkedin
Digg it
Yahoo
Delicious
StumbleUpon
Yammer
Reddit
Technorati
FriendFeed
Email

Back to the top
