Sample code for 30+ languages & platforms
Lianja

Setting a HTTP Max Response Size

Demonstrates the MaxResponseSize property.

Chilkat Lianja Downloads

Lianja
llSuccess = .F.

loHttp = createobject("CkHttp")

lnMaxSz = 16384
loHttp.MaxResponseSize = lnMaxSz

// Try to get something larger, such as hamlet.xml which is 279658 bytes
lcXmlStr = loHttp.QuickGetStr("https://chilkatsoft.com/hamlet.xml")
if (loHttp.LastMethodSuccess = .F.) 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.
    ? loHttp.LastErrorText
    release loHttp
    return
endif

? "OK"


release loHttp