Xbase++
Xbase++
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 Xbase++ Downloads
LOCAL nSuccess
LOCAL oRest
LOCAL nBTls
LOCAL nBAutoReconnect
LOCAL cResponseText
nSuccess := 0
oRest := CreateObject("Chilkat.Rest")
nBTls := 1
nBAutoReconnect := 1
nSuccess := oRest:Connect("example.com", 443, nBTls, nBAutoReconnect)
IF (nSuccess == 0)
? oRest:LastErrorText
oRest:destroy()
RETURN
ENDIF
// Send a complete request with no request body, such as a GET or DELETE. The response body is read
// as text and returned.
cResponseText := oRest:FullRequestNoBody("GET", "/api/items/123")
IF (oRest:LastMethodSuccess == 0)
? oRest:LastErrorText
oRest:destroy()
RETURN
ENDIF
? cResponseText
oRest:destroy()