Sample code for 30+ languages & platforms
Xbase++

HTTP DELETE with Body

See more HTTP Examples

Demonstrates how to send a DELETE request with a body.

Chilkat Xbase++ Downloads

Xbase++
LOCAL nSuccess
LOCAL oHttp
LOCAL cRequestBody
LOCAL oResp

nSuccess := 0

//  This example assumes the Chilkat API to have been previously unlocked.
//  See Global Unlock Sample for sample code.

oHttp := CreateObject("Chilkat.Http")

//  Use the HttpStr method (or HttpSb) to send a DELETE request with a body.
cRequestBody := '{ "abc": 123 }'
oResp := CreateObject("Chilkat.HttpResponse")
nSuccess := oHttp:HttpStr("DELETE", "https://example.com/something", cRequestBody, "utf-8", "application/json", oResp)
IF (nSuccess == 0)
    ? oHttp:LastErrorText
    oHttp:destroy()
    oResp:destroy()
    RETURN
ENDIF

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

oHttp:destroy()
oResp:destroy()