Skip to main content

delete()

sends a DELETE request to the server

delete<T>(url: string, data?: { [key: string]: any; } | string, config?: object): Promise<T>;

Parameters:

  • url: string - the URL the request is sent to
  • data: object | string - optional, the data sent to the server by the DELETE-request
  • config: object - optional, the configuration object of the request. It can contain the following options:
    • responseType: string - the type of data that you are expecting back from the server. The available types are:
      • "text" - returns the plain text as a string
      • "xml" - returns the result parsed as XML
      • "json" - returns the result as JSON
    • headers: object - optional, the headers of the request

Returns:

A "promise" of the data object.

Example

dhx.ajax.delete(url, {id: "2"}).then(function (data){
console.log(data);
});

Related sample: Data. Ajax DELETE