-2

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 ?

  • What page are you on with the console open? From memory, you cannot make requests from the blank _"new tab"_ page – Phil Apr 06 '23 at 00:30
  • Does this answer your question? [fetch() works in Extension but fails in Chrome Console/Snippet](https://stackoverflow.com/q/68163959/283366) – Phil Apr 06 '23 at 00:32

1 Answers1

-1

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.