作者q10242 (黑田佑司)
看板Ajax
标题No 'Access-Control-Allow-Origin'
时间Tue Dec 5 12:51:55 2017
我也不知道HTTP的问题是不是在这里问
小弟在做一个串流服务 中间有一支API是用JQuery的$.post
去不断询问金流服务商的伺服器
跟金流商要订单的资料
在Console里面的错误讯息一直都是
No 'Access-Control-Allow-Origin' header is present on the requested resource.
Origin '
http://mywebsite.com' is therefore not allowed access.
像这种的是否只能必须要请金流服务商开启白名单?
因为对方的这支API网址只提供POST 不提供GET服务 所以好像也不能使用JSONP来要资料
有没有其他方式呢
--
※ 发信站: 批踢踢实业坊(ptt.cc), 来自: 180.176.128.70
※ 文章网址: https://webptt.com/cn.aspx?n=bbs/Ajax/M.1512449519.A.0E4.html
1F:推 mrbigmouth: 对 或者是在後端呼叫取得资讯後再提供给前端 12/05 12:58
2F:→ tedwu2001: 自架server用server端去call 12/05 13:44
3F:推 DolphinLinn: 同源政策 用一个server做proxy 12/05 13:47
4F:推 ghmsxtwo: 好像在soft_job版看到一样的问题... 12/05 18:03
5F:推 aspdoctor: 前端那台做个反向代理就行了,把你自己网域的abc.com/ 12/06 00:07
6F:→ aspdoctor: api 指向对方网域 12/06 00:07
7F:推 aspdoctor: 关键字 nginx reverse proxy 12/06 00:09
感谢
※ 编辑: q10242 (180.176.128.70), 12/07/2017 10:11:32