.NET Core C#
.NET Core C#
HTTP DELETE with Body
See more HTTP Examples
Demonstrates how to send a DELETE request with a body.Chilkat .NET Core C# Downloads
bool success = false;
// This example assumes the Chilkat API to have been previously unlocked.
// See Global Unlock Sample for sample code.
Chilkat.Http http = new Chilkat.Http();
// Use the HttpStr method (or HttpSb) to send a DELETE request with a body.
string requestBody = "{ \"abc\": 123 }";
Chilkat.HttpResponse resp = new Chilkat.HttpResponse();
success = http.HttpStr("DELETE","https://example.com/something",requestBody,"utf-8","application/json",resp);
if (success == false) {
Debug.WriteLine(http.LastErrorText);
return;
}
Debug.WriteLine("Response status: " + Convert.ToString(resp.StatusCode));
Debug.WriteLine("Response body: ");
Debug.WriteLine(resp.BodyStr);