Axios, POST request to Flask

前端 未结 2 1736
刺人心
刺人心 2021-01-06 17:49

I try to make a POST to a flask server using axios:

var config = { headers: {  
                      \'Content-Type\': \'application/json\',
                        


        
2条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2021-01-06 18:35

    You need to add CORS support to your Flask app. See a related threat here: Flask-CORS not working for POST, but working for GET. A popular CORS extension for Flask can be found here: https://flask-cors.readthedocs.io/en/latest/.

提交回复
热议问题