Error 422: Unprocessable entity when I send form data from JS script #7038
Replies: 22 comments
-
Try sending a request with a header. const response = await fetch('http://127.0.0.1:8000/test', {
method: 'POST',
data: formData,
headers: {'content-type': 'multipart/form-data'}
}) |
Beta Was this translation helpful? Give feedback.
-
@ycd the error is now |
Beta Was this translation helpful? Give feedback.
-
What is the error in the response? |
Beta Was this translation helpful? Give feedback.
-
|
Beta Was this translation helpful? Give feedback.
-
Click on the three little dots next to body? |
Beta Was this translation helpful? Give feedback.
-
|
Beta Was this translation helpful? Give feedback.
-
Try looking at the response in the network tab instead? That will probably be easier |
Beta Was this translation helpful? Give feedback.
-
@Mause |
Beta Was this translation helpful? Give feedback.
-
Is there an error in server logs? |
Beta Was this translation helpful? Give feedback.
-
What about |
Beta Was this translation helpful? Give feedback.
-
@Mause Just |
Beta Was this translation helpful? Give feedback.
-
@ycd back to |
Beta Was this translation helpful? Give feedback.
-
Usually 400 with |
Beta Was this translation helpful? Give feedback.
-
@Kludex Yeah I do |
Beta Was this translation helpful? Give feedback.
-
Which version of python-multipart are you using? |
Beta Was this translation helpful? Give feedback.
-
@Mause 0.0.5 |
Beta Was this translation helpful? Give feedback.
-
The request went through when using XMLHttpRequest. Closing this issue. |
Beta Was this translation helpful? Give feedback.
-
Thanks for the help here everyone! 👏 🙇 Thanks for reporting back and closing the issue 👍 |
Beta Was this translation helpful? Give feedback.
-
Has anyone figured out what the issue was? I have a frontend which must use .fetch() so cannot use XMLHttpRequest. |
Beta Was this translation helpful? Give feedback.
-
Hello, I ran into the same issue, using fetch and XMLHttpRequest. |
Beta Was this translation helpful? Give feedback.
-
I am getting same error using fetch. Anyone have solution? |
Beta Was this translation helpful? Give feedback.
-
Do someone have a solution ? I have the same issue |
Beta Was this translation helpful? Give feedback.
-
Backend
Frontend
Response
Description
/test
endpoint is simply supposed to recieve a form containing onlyusername
and print it out.Environment
Beta Was this translation helpful? Give feedback.
All reactions