Sample code for 30+ languages & platforms
Dart

HTTP DELETE with Body

See more HTTP Examples

Demonstrates how to send a DELETE request with a body.

Chilkat Dart Downloads

Dart
import 'package:chilkat/chilkat.dart';

void main() {
  // This example assumes the Chilkat API to have been previously unlocked.
  // See Global Unlock Sample for sample code.

  final http = CkHttp();

  // Use the HttpStr method (or HttpSb) to send a DELETE request with a body.
  final requestBody = '{ "abc": 123 }';
  final resp = CkHttpResponse();
  try {
    http.httpStr('DELETE', 'https://example.com/something', requestBody, 'utf-8', 'application/json', resp);
  } on ChilkatException catch (e) {
    print(e.lastErrorText);
    return;
  }

  print('Response status: ${resp.statusCode}');
  print('Response body: ');
  print(resp.bodyStr);
}