-1

I have the following code:

const requestData = {
    id: 123
};
this.http.delete(APIURL, {params: requestData})
    .subscribe(() => {
         do_something
    }, () => {
        log_error
    });

For some reason, the .delete is not sending the params to the URL How can I make it send the params similar to a POST (form data)?

Scobee
  • 448
  • 7
  • 22

1 Answers1

0

You have to pass the id in the url

this.http.delete(APIURL + '/' + requestData.id)
    .subscribe(() => {
         do_something
    }, () => {
        log_error
    });
wFitz
  • 1,266
  • 8
  • 13
  • I think that depends in your endpoint, what are using ? I use asp.net core and to delete I have to pass the Id in the url and no body. – wFitz Aug 14 '18 at 23:30