Lianja
Lianja
Example: Http.QuickGetStr method
Demonstrates theQuickGetStr method.
Chilkat Lianja Downloads
loHttp = createobject("CkHttp")
// Keep the response body if there's an error.
loHttp.KeepResponseBody = .T.
// Send the HTTP GET and return the content in a string.
lcStr = loHttp.QuickGetStr("https://www.chilkatsoft.com/helloWorld.json")
if (loHttp.LastMethodSuccess = .F.) 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
return
endif
? lcStr
? "Success"
release loHttp