# Form Post 405 error

**URL:** <https://community.hubspot.com/t/form-post-405-error/20870>\
**Category:** APIs & Integrations\
**Tags:** forms\
**Created:** [May 14, 2020, 12:57pm UTC](https://community.hubspot.com/t/form-post-405-error/20870 "2020-05-14T12:57:14Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![RB\_Simon](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/rb_simon/32/68963_2.png) [@RB\_Simon](https://community.hubspot.com/u/RB_Simon)\
**Post date:** [May 14, 2020, 12:57pm UTC](https://community.hubspot.com/t/form-post-405-error/20870/1 "2020-05-14T12:57:14Z")

</div>

I’ve checked the other posts on this issue and can’t find where I am going wrong in there.

My form submissions are returning 405 errors. I’m not sure why.

The confusing thing is that while I (and others) are getting the 405 error. It seems others aren’t as when I check the form submission on Hubspot I’m still getting submissions coming through,

Here’s how I’m preparing the data:

```auto
const postData = {
 context: {
 hutk: Cookies.get('hubspotutk'),
 pageName: pageTitle,
 pageUri: window.location.href,
 },
 legalConsentOptions: {
 consent: {
 consentToProcess: true,
 text:
 'I agree to allow Company to store and process my personal data.',
 communications: [
 {
 value: true,
 subscriptionTypeId: 999,
 text: 'I agree to receive communications from Company.',
 },
 ],
 },
 },
 fields: [],
 };

 postData.fields = fieldData.map(field => {
 return { name: field.name, value: field.value };
 });

 const headers = {
 Accept: 'application/json',
 'Content-Type': 'application/json',
 'Content-Length': (Object.keys(postData).length).toString(),
 };

 fetch(hubspotAPIEndpoint, {
 method: 'POST',
 headers,
 body: JSON.stringify(postData),
 mode: 'cors',
 });

```

And here’s the data:

```auto
{
 body: "{"context":{"pageName":"Mission Beyond","pageUri":"http://localhost:8000/"},"legalConsentOptions":{"consent":{"consentToProcess":true,"text":"I agree to allow Company to store and process my personal data.","communications":[{"value":true,"subscriptionTypeId":999,"text":"I agree to receive communications from Company."}]}},"fields":[{"name":"firstname","value":"test"},{"name":"lastname","value":"test"},{"name":"email","value":"test@example.com"}]}",
 headers: {
 Accept: "application/json",
 Content-Length: "3",
 Content-Type: "application/json", },
 method: "POST",
 mode: "cors",}

```

Let me know if I can clarify anything further, thanks for any help.

---

<div class="post-metadata">

**Author:** ![RB\_Simon](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/rb_simon/32/68963_2.png) [@RB\_Simon](https://community.hubspot.com/u/RB_Simon)\
**Post date:** [May 14, 2020, 2:24pm UTC](https://community.hubspot.com/t/form-post-405-error/20870/2 "2020-05-14T14:24:27Z")

</div>

Is there any chance this is rejecting example emails like [test@example.com](mailto:test@example.com)? Using my own email produces no error but using [test@example.com](mailto:test@example.com) returns the 405.

---

<div class="post-metadata">

**Author:** ![WendyGoh](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/wendygoh/32/42320_2.png) [@WendyGoh](https://community.hubspot.com/u/WendyGoh)\
**Post date:** [May 15, 2020, 3:49am UTC](https://community.hubspot.com/t/form-post-405-error/20870/3 "2020-05-15T03:49:08Z")

</div>

Hey [@RB\_Simon](https://community.hubspot.com/t5/user/viewprofilepage/user-id/131239),

I believe this is likely because the email: _[test@example.com](mailto:test@example.com)_ is invalid. The form response body will return a list of errors which you can learn more here: [Submit data for a form | Forms API](https://developers.hubspot.com/docs/methods/forms/submit_form).

If you’d like to skip validation, you’d need to set

```auto
"skipValidation": true

```

on the form request body.

---

<div class="post-metadata">

**Author:** ![RB\_Simon](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/rb_simon/32/68963_2.png) [@RB\_Simon](https://community.hubspot.com/u/RB_Simon)\
**Post date:** [May 15, 2020, 8:33am UTC](https://community.hubspot.com/t/form-post-405-error/20870/4 "2020-05-15T08:33:13Z")

</div>

Thanks Wendy
