Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

139
Visualizações
Why is my Discord Webhook throwing POST Error 400?

I'm trying to figure out why this is throwing me a 400 on POST, this is inside of a submit event listener for a form on my website. The form itself works as expected and emails me the appropriate data, but this webhook integration is failing and I'm not sure why.

const webhookBody = {
    embeds: [{
        title: 'Contact Form Submitted',
        fields: [
            { name: 'From:', value: nameForm.value },
            { name: 'Email:', value: emailForm.value },
            { name: 'Message:', value: messageForm.value }
        ]
    }],
};

const webhookUrl = 'myWebhookURL';

fetch(webhookUrl, {
    method: 'POST',
    headers: {
        'Content-Type': 'application/json',
    },
    body: JSON.stringify(webhookBody),
})
.then(data => console.log(webhookBody));

The console gives back the object, but the field values are returning as empty strings. Maybe this has something to do with it?

about 4 years ago · Juan Pablo Isaza
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda