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
记录下,免得忘了
评论
登录后参与技术讨论,分享你的经验与见解。
登录 / 注册暂无评论