Chilkat2-Python
Chilkat2-Python
HTTP DELETE with Body
See more HTTP Examples
Demonstrates how to send a DELETE request with a body.Chilkat Chilkat2-Python Downloads
import sys
import chilkat2
success = False
# This example assumes the Chilkat API to have been previously unlocked.
# See Global Unlock Sample for sample code.
http = chilkat2.Http()
# Use the HttpStr method (or HttpSb) to send a DELETE request with a body.
requestBody = "{ \"abc\": 123 }"
resp = chilkat2.HttpResponse()
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.StatusCode))
print("Response body: ")
print(resp.BodyStr)