(AutoIt) HTTP DELETE with Body
Demonstrates how to send a DELETE request with a body. Note: This example requires Chilkat v11.0.0 or greater.
Local $bSuccess = False
; This example assumes the Chilkat API to have been previously unlocked.
; See Global Unlock Sample for sample code.
$oHttp = ObjCreate("Chilkat.Http")
; Use the HttpStr method (or HttpSb) to send a DELETE request with a body.
Local $sRequestBody = "{ ""abc"": 123 }"
$oResp = ObjCreate("Chilkat.HttpResponse")
$bSuccess = $oHttp.HttpStr("DELETE","https://example.com/something",$sRequestBody,"utf-8","application/json",$oResp)
If ($bSuccess = False) Then
ConsoleWrite($oHttp.LastErrorText & @CRLF)
Exit
EndIf
ConsoleWrite("Response status: " & $oResp.StatusCode & @CRLF)
ConsoleWrite("Response body: " & @CRLF)
ConsoleWrite($oResp.BodyStr & @CRLF)
|