Ajax 跨域请求 Flask 页面请求不到的解决

前端之家收集整理的这篇文章主要介绍了Ajax 跨域请求 Flask 页面请求不到的解决前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。

参考:

http://stackoverflow.com/questions/25860304/how-do-i-set-response-headers-in-flask

也就是说,设置下响应头就可以了,如:

  
1 2 3 resp = Response(js,status = 200 ,mimetype = ' application/json ' ) 4 resp.headers[ ' Access-Control-Allow-Origin ' ] = ' * ' 5 6 return resp 7

记录下,免得忘了

原文链接:https://www.f2er.com/ajax/163364.html

猜你在找的Ajax相关文章