Ivan Ivanovich2020-06-17 10:56:15
Ivan Ivanovich, 2020-06-17 10:56:15

404 error on request?

Hello. I am making a request to check google captcha.

const requestVerif = ()=>{
          https.get(verifUrl, (resp) => {
            let data = '';
            resp.on('data', (chunk) => {
              data += chunk;
            resp.on('end', () => {
          }).on("error", (err) => {
            console.log("Error: " + err.message);


verifUrl is exactly correct, because if I go to the address in the browser, the result is successful.

Error while executing the request:

<TITLE>Not Found</TITLE>
<H1>Not Found</H1>
<H2>Error 404</H2>

Pure node

Please tell me why this occurs and how to fix it.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
Pavel Didenko, 2020-06-17

If https is a built-in node module, then you access your host + the URL that you specified, respectively, it will return 404, because you do not have such a route. If you need to fetch this URL, you can put the fetch package for the node or axios, for example

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question