I am hitting the API by using payload and in headers giving Content-Type : 'application/json'
still in browser in request headers I’m seeing Content-Type : 'text/plain'
Because of that in the backend I am getting payload in Content-Type : 'text/plain'
export const abctrigger = (payload , signal) => {
Return fetch (API_URL, {
method: post,
Signal: signal
Body: JSON.stringify(payload),
headers: {
Content-Type : 'application/json'
}
})
.then((response) => response.text())
.then((response) => {
return respon se;
})
}
I want to Change request headers to to Content-Type : 'application/json'