-3

If I make a fetch request in Node.js, and I want to make the fetch request look as browser-like as possible, what headers should I set besides the obvious User Agent header?

Similar to this question: Can I make a get request look like that of a browsers? but a little more specific (I only care about setting headers).

Foobar
  • 7,458
  • 16
  • 81
  • 161
  • 2
    Make the request from your browser and capture the headers. You can even export the request as `fetch` code (right-click on the request in dev-tools and select _Copy -> Copy as fetch_) – Phil Jun 06 '22 at 06:26

1 Answers1

-2

Header should be like this:

{
User-Agent: Firefox,
 //your rest header
}

User-Agent shows the agent the user is using to communicate with the server. I have shown one in the picture in the link. Image of Wikipedia request on my computer. See the red highlighted area. Other information have been obfuscated as I am Wikipedia writer and to protect this account:

Wikipedia image .

halfer
  • 19,824
  • 17
  • 99
  • 186
EpicAdidash
  • 137
  • 8