N
N
Nikita2021-02-21 11:36:53
Node.js
Nikita, 2021-02-21 11:36:53

Why does a request through the request package return 404?

Why executing the code

request
    .get('https://efind.ru/offer/max232')
    .on('response', (response) => {
        console.log(response.statusCode)
    })


returns a 404 code, but if you open the page in a browser, it exists.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alex K, 2021-02-21
@Prynik

This resource has a "user-agent" check in its headers. Adding this header solves the problem.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question