Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

133
Views
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
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!