0

I want to do a Post-Request using Axios. It has to unclude Headers, a Body and uses a Proxy. For some reason it doesn't work when I add the Headers or the Body (it doesn't use the Proxy)

await axios.post(
                        baseUrl, {
                        "email": mail,
                        "username": username,
                        "password": password,
                        "invite": invite,
                        "consent": true,
                        "date_of_birth": birthday,
                        "gift_code_sku_id": null,
                        "captcha_key": key
                    }, {
                        headers: {
                            "Host": "discord.com",
                            "Authorization": "undefined",
                            "Accept-Language": "en-US",
                            "User-Agent": randomUserAgent(),
                            "Content-Type": "application/json",
                            "Origin": "https://discord.com",
                            "Referer": "https://discord.com/register",
                            "Accept-Encoding": "gzip, deflate, br"
                        }
                    }, {
                        proxy: {
                            host: pickedProxy.split(":")[0],
                            port: pickedProxy.split(":")[1],
                            auth: {
                                username: pickedProxy.split(":")[2],
                                password: pickedProxy.split(":")[3]
                            }
                        }
                    });
Error 404
  • 1
  • 2
  • Looks like your URL is secured e.g.https based so check this you have to find some alternate way as there is a bug in axios https://stackoverflow.com/questions/55981040/how-to-use-axios-with-a-proxy-server-to-make-an-https-call – Zain Ul Abidin May 10 '21 at 10:51

0 Answers0