DELETE request backend how to fill out the field headers in fetch?

there is a method in the backend which expects front req.getHeader("teacherId")
how to fetch correctly fill in the headers?
5e99abc857a74033697184.png
with insomnia queried

Tried this:
fetch('http://localhost:8080/teachers', {
 method: 'DELETE',
 headers: {
 "teacherId": 8
}
 })
April 19th 20 at 12:33
1 answer
April 19th 20 at 12:35
The title is only there Teacherid becomes
const fetch = require('node-fetch');

fetch('https://httpbin.org/delete', {
 method: 'DELETE',
 headers: {
 "teacherId": 8
}
})
 .then(res => res.text())
 .then(text => {
console.log(text);
 });

the answer
/usr/local/bin/node /Users/evgenij/projects/fetch.js
{
 "args": {}, 
 "data": "", 
 "files": {}, 
 "form": {}, 
 "headers": {
 "Accept": "*/*", 
 "Accept-Encoding": "gzip,deflate", 
 "Host": "httpbin.org", 
 "Teacherid": "8", 
 "User-Agent": "node-fetch/1.0 (+https://github.com/bitinn/node-fetch)", 
 "X-Amzn-Trace-Id": "Root=1-5e99af90-fe7e43f7f3d1149a814fd762"
 }, 
 "json": null, 
 "origin": "*******", 
 "url": "https://httpbin.org/delete"
}

Find more questions by tags JavaScriptAJAX