Visual FoxPro
Visual FoxPro
Send a REST Request with No Body
See more REST Examples
Demonstrates Rest.FullRequestNoBody, which sends a complete request with no request body (such as a GET or DELETE) and returns the response body as text.
Background. This is the simplest full-request convenience method, ideal for retrieval and deletion calls that carry no request payload.
Chilkat Visual FoxPro Downloads
LOCAL lnSuccess
LOCAL loRest
LOCAL lnBTls
LOCAL lnBAutoReconnect
LOCAL lcResponseText
lnSuccess = 0
loRest = CreateObject('Chilkat.Rest')
lnBTls = 1
lnBAutoReconnect = 1
lnSuccess = loRest.Connect("example.com",443,lnBTls,lnBAutoReconnect)
IF (lnSuccess = 0) THEN
? loRest.LastErrorText
RELEASE loRest
CANCEL
ENDIF
* Send a complete request with no request body, such as a GET or DELETE. The response body is read
* as text and returned.
lcResponseText = loRest.FullRequestNoBody("GET","/api/items/123")
IF (loRest.LastMethodSuccess = 0) THEN
? loRest.LastErrorText
RELEASE loRest
CANCEL
ENDIF
? lcResponseText
RELEASE loRest