Sample code for 30+ languages & platforms
Visual FoxPro

HTTP DELETE with Body

See more HTTP Examples

Demonstrates how to send a DELETE request with a body.

Chilkat Visual FoxPro Downloads

Visual FoxPro
LOCAL lnSuccess
LOCAL loHttp
LOCAL lcRequestBody
LOCAL loResp

lnSuccess = 0

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

loHttp = CreateObject('Chilkat.Http')

* Use the HttpStr method (or HttpSb) to send a DELETE request with a body.
lcRequestBody = '{ "abc": 123 }'
loResp = CreateObject('Chilkat.HttpResponse')
lnSuccess = loHttp.HttpStr("DELETE","https://example.com/something",lcRequestBody,"utf-8","application/json",loResp)
IF (lnSuccess = 0) THEN
    ? loHttp.LastErrorText
    RELEASE loHttp
    RELEASE loResp
    CANCEL
ENDIF

? "Response status: " + STR(loResp.StatusCode)
? "Response body: "
? loResp.BodyStr

RELEASE loHttp
RELEASE loResp