Visual FoxPro
Visual FoxPro
Setting a HTTP Max Response Size
Demonstrates theMaxResponseSize property.
Chilkat Visual FoxPro Downloads
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