I\'m trying to talk to a somewhat RESTful API from an Angular 2 frontend.
To remove some item from a collection, I need to send some other data in addition to the re
Below is the relevant code example for Angular 2/4/5 projects:
let headers = new Headers({
'Content-Type': 'application/json'
});
let options = new RequestOptions({
headers: headers,
body: {
id: 123
}
});
return this.http.delete("http//delete.example.com/delete", options)
.map((response: Response) => {
return response.json()
})
.catch(err => {
return err;
});
Notice that
bodyis passed throughRequestOptions