0

whenever i am trying to make a get request with some custom headers as follows:

const sellClicked = async () => {
await fetch('/Sell', {
    headers: {
        "auth-token": localStorage.getItem("token"),
        'content-type': 'application/json'
    }
}).then((response) => { console.log(response); }).catch(err => console.log(err))

}

instead of rendering the desired page it's sending a status code 304 as a response to me :

in network section : image for network section

in browser console:

Response {type: 'basic', url: 'http://localhost:3000/Sell', redirected: false, status: 200, ok: true, …}

i am expecting a page to be rendered:

this is the endpoint at backend:

app.get("/sell", fetchuser, (req, res) => {
console.log("inside");
res.status(200).render('Sell');

})

0 Answers0