Replies: 1 comment
-
Maybe it requires specifying the content-type? const resp = await fetch(API_ENDPOINT + "volunteers/", {
method: "POST",
body: JSON.stringify(data),
+ headers: {
+ 'content-type': 'application/json'
+ }
}); |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Running the following form action on the dev server works totally fine, but when I deploy my app to Vercel it fails.
For context, it's
POST
-ing to a Django backend hosted on fly.io. In the logs, the Django server shows 422 Unprocessable Entity, meaning the request body could not even be parsed. I inspected the request via browser and it looks like both requests (dev & Vercel) had the exact same body.Switching to Axios solved the problem.
Am I missing something obvious? Why did regular fetch work locally but not on Vercel in this case?
Beta Was this translation helpful? Give feedback.
All reactions