Data that is returned to a browser can be compressed and decompressed by using
XMLHTTP. HTTP compression allows Internet Information Services (IIS) to send compressed content to a client, and URLMON is responsible for the decompression on the client side.
A client computer can use the
XMLHTTP object (MSXML2.XMLHTTP) to send an arbitrary HTTP request or data to a Web server and receive a response. More specifically, an
XMLHTTP POST uses HTTP to send data and a response request to a Web server's Active Server Pages (ASP) page. An
XMLHTTP GET just requests a response. The response is written to the browser's output by setting the
ContentType and passing the response to the
Response object.
The following article contains sample code in which the client uses the
XMLHTTP POST command to send data and request a response from an ASP page:
290591Â
(http://kbalertz.com/Feedback.aspx?kbNumber=290591/EN-US/
)
How To Submit Form Data by Using XMLHTTP or ServerXMLHTTP Object
Although IIS may store a compressed copy of the file in a temporary folder if static data is being retrieved, the data in the
XMLHTTP POST scenario is dynamic and no copy of the file is stored. IIS 5.0 compresses the file as it is generated and sends the compressed file to the browser.
For additional information, click the article number below
to view the article in the Microsoft Knowledge Base:
255801Â
(http://kbalertz.com/Feedback.aspx?kbNumber=255801/EN-US/
)
How to Determine if HTTP Compression Is in Use
To enable HTTP compression on GET or POST requests, the IIS settings for HTTP compression should be set by using the
Service tab of the WWW Service Master Properties. For more information on how to do this, see the IIS documentation. A fix has been developed to enable HTTP compression on POST requests and was first included in Windows 2000 Service Pack 2. This fix should be applied to the server with the receiver ASP. For more information on the fix, see the following Knowledge Base article:
259760Â
(http://kbalertz.com/Feedback.aspx?kbNumber=259760/EN-US/
)
Compression Is Not Enabled on POST Request
Alternatively,
ServerXMLHTTP provides methods and properties for server-safe HTTP access between different Web servers.
ServerXMLHTTP relies on WinHTTP. Currently, WinHTTP 4.0 and later does not support decompression; therefore,
ServerXMLHTTP code may not be used to engage compression and decompression of files.
255951Â
(http://kbalertz.com/Feedback.aspx?kbNumber=255951/EN-US/
)
HTTP Compression Methods and Files Used by IIS 5.0
290761Â
(http://kbalertz.com/Feedback.aspx?kbNumber=290761/EN-US/
)
Frequently Asked Questions about ServerXMLHTTP