Can't make a http request from Google Chrome console

501 Views Asked by At

Cannot make http request to my VPS server from Google Chrome console.

It is possible to send request to server from browser directly by simply going to http://11.11.111.11:5000/test (with proper IP address) and get right response. And all the requests also working in my React app with await fetch('http://11.11.111.11:5000/test').

But if I try to make request from Chrome console, for example with fetch how it is shown in this answer, it doesn't work and gives me net::ERR_TIMED_OUT error.

Will appreciate if someone could gladly explain to me what am I doing wrong ?

1

There are 1 best solutions below

0
Saagar Takhi On

It would have been much more helpful to see the complete error message, preferably with a reproducible sandbox or screenshots.

But to try to answer this, if it is failing, then it must have to do with what service is deployed on that port.

I can see a few differences in headers between call made from browser url (left) and console fetch (right): Json diff comparing request headers from different points

The response from server may differ for both only if it is treating accept, sec-fetch-dest or sec-fetch-mode header differently.

This is the best I could come up with.