Sample code for 30+ languages & platforms
Xbase++ Requires Chilkat v11.0.0+

Example: Http.HttpNoBody method

Demonstrates how to use the HttpNoBody method to send HTTP requests without a request body (e.g., GET, DELETE, HEAD) and receive the response in a Chilkat Http response object.

Chilkat Xbase++ Downloads

Xbase++
LOCAL nSuccess
LOCAL oHttp
LOCAL oResp
LOCAL cUrl

nSuccess := 0

oHttp := CreateObject("Chilkat.Http")
oResp := CreateObject("Chilkat.HttpResponse")

//  Send a DELETE request to https://api.example.com/users/123
cUrl := "https://api.example.com/users/123"
nSuccess := oHttp:HttpNoBody("DELETE", cUrl, oResp)
IF (nSuccess == 0)
    ? oHttp:LastErrorText
    oHttp:destroy()
    oResp:destroy()
    RETURN
ENDIF

? "Response Status Code: " + Str(oResp:StatusCode)
? "Response body:"
? oResp:BodyStr

oHttp:destroy()
oResp:destroy()