Skip to content
Advertisement

How can I send XML data using JQuery AJAX as a delete request?

I need to send an XML type data to backend using jquery, ajax as a DELETE request. This returns empty array from backend request body. How can I send id properly?

here is my code,

JavaScript

I need to send this data,

JavaScript

this 2 comes from the function parameter.

this is my backend in express

JavaScript

this returns empty object.How can I solve this?

Advertisement

Answer

If you want to send XML, don’t say you’re sending application/json:

JavaScript

By returning the Ajax request, you can do something like this:

JavaScript
User contributions licensed under: CC BY-SA
4 People found this is helpful
Advertisement