Visual FoxPro
Visual FoxPro
Example: Http.QuickGetStr method
Demonstrates theQuickGetStr method.
Chilkat Visual FoxPro Downloads
LOCAL loHttp
LOCAL lcStr
loHttp = CreateObject('Chilkat.Http')
* Keep the response body if there's an error.
loHttp.KeepResponseBody = 1
* Send the HTTP GET and return the content in a string.
lcStr = loHttp.QuickGetStr("https://www.chilkatsoft.com/helloWorld.json")
IF (loHttp.LastMethodSuccess = 0) THEN
IF (loHttp.LastStatus = 0) THEN
* Communications error. We did not get a response.
? loHttp.LastErrorText
ELSE
? "Response status code: " + STR(loHttp.LastStatus)
? "Response body error text:"
? loHttp.LastResponseBody
ENDIF
RELEASE loHttp
CANCEL
ENDIF
? lcStr
? "Success"
RELEASE loHttp