Hi I am newbie and I tried to get data from my backend server.
this is the code.
import { Headers, fetch } from 'node-fetch';
var response = await fetch("https://mybackend/api/call", {
method: 'POST',
headers: {
"Authorization": "Bearer xxxxxxxxxxxx",
},
body: JSON.stringify({
data: encodeURI("encodedDescription"),
})
});
var json = await response.json();
console.log(json);
it works fine in postman.
please let me know what the problem is.