Sample code for 30+ languages & platforms
Visual Basic 6.0

Setting a HTTP Max Response Size

Demonstrates the MaxResponseSize property.

Chilkat Visual Basic 6.0 Downloads

Visual Basic 6.0
Dim success As Long
success = 0

Dim http As New ChilkatHttp

Dim maxSz As Long
maxSz = 16384
http.MaxResponseSize = maxSz

' Try to get something larger, such as hamlet.xml which is 279658 bytes
Dim xmlStr As String
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.
    Debug.Print http.LastErrorText
    Exit Sub
End If

Debug.Print "OK"