Sample code for 30+ languages & platforms
Visual FoxPro

Setting a HTTP Max Response Size

Demonstrates the MaxResponseSize property.

Chilkat Visual FoxPro Downloads

Visual FoxPro
LOCAL lnSuccess
LOCAL loHttp
LOCAL lnMaxSz
LOCAL lcXmlStr

lnSuccess = 0

loHttp = CreateObject('Chilkat.Http')

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 = 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.
    ? loHttp.LastErrorText
    RELEASE loHttp
    CANCEL
ENDIF

? "OK"

RELEASE loHttp