Chrome devtools has a feature that allows to copy a request in the browser as node-fetch
But for some reason if I try to run this request in node
it returns:
status: 403,
statusText: 'Forbidden'
I am by no means an expert on http requests, but what could be the issue of this? The headers sent:
headers: {
accept:
'text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9',
'accept-language': 'de-DE,de;q=0.9,en-DE;q=0.8,en;q=0.7,en-US;q=0.6',
'cache-control': 'no-cache',
pragma: 'no-cache',
'sec-ch-ua':
'"Google Chrome";v="107", "Chromium";v="107", "Not=A?Brand";v="24"',
'sec-ch-ua-mobile': '?0',
'sec-ch-ua-platform': '"macOS"',
'sec-fetch-dest': 'document',
'sec-fetch-mode': 'navigate',
'sec-fetch-site': 'none',
'sec-fetch-user': '?1',
'upgrade-insecure-requests': '1',
},
referrerPolicy: 'strict-origin-when-cross-origin',
body: null,
method: 'GET',
Can anyone refresh me on what I am missing here?