CkPython
CkPython
HTTP DELETE with Body
See more HTTP Examples
Demonstrates how to send a DELETE request with a body.Chilkat CkPython Downloads
import sys
import chilkat
success = False
# This example assumes the Chilkat API to have been previously unlocked.
# See Global Unlock Sample for sample code.
http = chilkat.CkHttp()
# Use the HttpStr method (or HttpSb) to send a DELETE request with a body.
requestBody = "{ \"abc\": 123 }"
resp = chilkat.CkHttpResponse()
success = http.HttpStr("DELETE","https://example.com/something",requestBody,"utf-8","application/json",resp)
if (success == False):
print(http.lastErrorText())
sys.exit()
print("Response status: " + str(resp.get_StatusCode()))
print("Response body: ")
print(resp.bodyStr())