2021-05-27

http fetch gives different status than network?

I must be doing something wrong, but I am trying to ping a service until I get a 200 response. When I look in the network tab in my browser (chrome), I get a 304:

enter image description here

However, when I print out the following code:

const s1 = await fetch(`./${cluster}/api`)
const s2 = await fetch(`./${cluster}/dashboard`)
console.log(s1.status, s2.status)

I get:

enter image description here

It's hard to read sorry, but it says 200 200.

Why do I get a 200 when I check the status, but a 304 in the network tab?



from Recent Questions - Stack Overflow https://ift.tt/3yJmI4S
https://ift.tt/3ukeJIp

No comments:

Post a Comment