Relative Content

Tag Archive for pythonreactjsflaskaxios

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:

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?