1

I have a question about NodeJS and PHP.

I have a NodeJS server. I want to query an external API (https://md5decrypt.net/Api/).

Postman shows me the result as text and in NodeJS I have no idea how to do it.

How can I get a response from an external API (php) using NodeJS?

I am a beginner.

I tried:

const axios = require("axios");

const qs = require("qs");

function checkInApi(hash) {
    axios
        .post(
            "https://md5decrypt.net/en/Api/api.php?",
            qs.stringify({
                hash: hash,
                hash_type: "md5",
                email: "secretmail",
                code: "secretcode",
            })
        )
        .then((res) => {
            console.log(`statusCode: ${res.statusCode}`);
            console.log(res);
            console.log(`statusCode: ${res.data}`);
        })
        .catch((error) => {
            console.error(error);
        });
}

module.exports={
    checkInApi: checkInApi
}

API: https://md5decrypt.net/Api/

hash: 1d7c2923c1684726dc23d2901c4d8157 expected answer: adam

Thank you very much!!

devon
  • 19
  • 2

0 Answers0