Axios post call works but no other code is run, state not updated
The frontend has a function that handles a file upload and send the file to the backend to be processed. The backend then returns a json that should be used to update my React state. I set up a test call with axios.get()
that works fine, where the backend passes in a string that is displayed on the webpage. console.log()
also works fine in this test function. When it comes to my uploadDoc
function though, no console.log()
s get run and state isn’t updated. Here’s my code:
400 Bad Request when trying to upload a file with React and send it to backend with Flask
In the site I’m building the user can upload a file (I’m using PrimeReact for the file upload), and then that file should get sent to the backend server to be used later. However, no matter what I try I’m always getting 400 Bad Request: The browser (or proxy) sent a request that this server could not understand.
Flask not processing incoming request data from Axios
I am very new to Flask api and front end as well. I am struggling to receive the data from in the backend Flask application from react frontend which involves posting the form data vis Axios. Sharing the code below, kindly advise. As of now the Flask api receiving null/ from form on form submit. what am I missing?