Sample code for 30+ languages & platforms
Classic ASP

Setting a HTTP Max Response Size

Demonstrates the MaxResponseSize property.

Chilkat Classic ASP Downloads

Classic ASP
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body>
<%
success = 0

set http = Server.CreateObject("Chilkat.Http")

maxSz = 16384
http.MaxResponseSize = maxSz

' Try to get something larger, such as hamlet.xml which is 279658 bytes
xmlStr = http.QuickGetStr("https://chilkatsoft.com/hamlet.xml")
If (http.LastMethodSuccess = 0) Then
    ' If the LastErrorText contains the string "MaxResponseSize",
    ' then the HTTP request failed because the response body would've been larger than the max allowed response size.
    Response.Write "<pre>" & Server.HTMLEncode( http.LastErrorText) & "</pre>"
    Response.End
End If

Response.Write "<pre>" & Server.HTMLEncode( "OK") & "</pre>"

%>
</body>
</html>