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