Sample code for 30+ languages & platforms
React Native

HTTP DELETE with Body

See more HTTP Examples

Demonstrates how to send a DELETE request with a body.

Chilkat React Native Downloads

React Native
import { Http, HttpResponse } from '@chilkat/react-native'

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

  const http = new Http();

  // Use the HttpStr method (or HttpSb) to send a DELETE request with a body.
  const requestBody = '{ "abc": 123 }';
  const resp = new HttpResponse();
  try {
    await http.httpStrAsync('DELETE', 'https://example.com/something', requestBody, 'utf-8', 'application/json', resp);
  } catch {
    console.log(http.lastErrorText);
    return;
  }

  console.log(`Response status: ${resp.statusCode}`);
  console.log('Response body: ');
  console.log(resp.bodyStr);
}