No 'Access-Control-Allow-Origin'

楼主: q10242 (黑田祐司)   2017-12-05 12:51:55
我也不知道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来要资料
有没有其他方式呢
作者: mrbigmouth (大嘴先生)   2017-12-05 12:58:00
对 或者是在后端呼叫取得资讯后再提供给前端
作者: tedwu2001   2017-12-05 13:44:00
自架server用server端去call
作者: DolphinLinn (怕水海豚)   2017-12-05 13:47:00
同源政策 用一个server做proxy
作者: ghmsxtwo (YI)   2017-12-05 18:03:00
好像在soft_job版看到一样的问题...
作者: aspdoctor (大崎)   2017-12-06 00:07:00
前端那台做个反向代理就行了,把你自己网域的abc.com/api 指向对方网域关键字 nginx reverse proxy

Links booklink

Contact Us: admin [ a t ] ucptt.com