DELETE request backend how to send a query using the Fetch?

5e99ff7accde1658914438.png
Tried so
let delTeacher = (id) => {
teachers.delete(id);

 fetch('http://localhost:8080/teachers', {
 method: 'DELETE',
 headers: {
 teacher: id
 } 
})
};
April 19th 20 at 12:36
2 answers
April 19th 20 at 12:38
fetch(url, {method: 'DELETE', ...})
fetch('http://localhost:8080/teachers', {
 method: 'DELETE',
...
 })

can suggest how to continue to fill?
around 100 options tried, not pravino( - leatha_Schmeler commented on April 19th 20 at 12:41
April 19th 20 at 12:40
In body to pass the ID I tried? And in the header type
method: "DELETE",
headers: {
'Content-Type': 'application/json'
},
body: id - Rozella.Donnelly commented on April 19th 20 at 12:43

Find more questions by tags JavaScript