PHP跨域请求
我是一个绿色程序员,最初是尝试用JS进行跨域请求。我很快了解到这是不允许的。与此处发布的类似问题不同,我想看看是否可以使用 PHP 来代替 JSONP 请求来制作它们。这可能吗?
简单的工作流程...
BROWSER: POST to my PHP the request-payload & request-headers
PHP: POST to Other Domain's URL the request-payload & request-headers
Other Domain: Process Request and send response
PHP: Send the Response-Content and Response-Header Info back to the browser
这是我正在尝试使用的 http://msdn.microsoft.com/en-us/library/bb969500%28v=office.12%29.aspx
我的目标是制作一个 Communicator Web访问基于网络且适合移动设备的客户端。
一个工作示例的链接就太棒了!
I am a green programmer and I was originally trying to make cross domain requests in JS. I quickly learned that this is not allowed. Unlike similar questions posted on here, I would like to see if I can use PHP to make them for me instead of JSONP requests. Is this possible?
Simple workflow...
BROWSER: POST to my PHP the request-payload & request-headers
PHP: POST to Other Domain's URL the request-payload & request-headers
Other Domain: Process Request and send response
PHP: Send the Response-Content and Response-Header Info back to the browser
Here is what I am trying to work with http://msdn.microsoft.com/en-us/library/bb969500%28v=office.12%29.aspx
My goal is to make a Communicator Web Access Client that is web based and mobile friendly.
A link to a working example would be awesome!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
在这种情况下,CURL 是您的选择,简单如下:
在这种情况下,$result 将包含站点的 html 代码。请注意,它不会像您在浏览器上访问该网站一样执行任何 JavaScript。
CURL yould be your option in this case, something simple as:
In this case, $result would contain the html code of the site. Please be aware that it doesn't going to execute any javascript as if you were visiting the site on the browser.
您正在谈论网络服务,目标似乎是处理付款。任何主要的支付网关都有为此准备的 API。不管怎样,你可以自己学习。这是一个很好的起点 http://ajaxonomy.com/ 2008/xml/web-services-part-1-soap-vs-rest
You are talking about web services and seems that the goal is process payments. Any major payment gateway have APIs prepared for that. In any case you can study by your own. Here a good starting point http://ajaxonomy.com/2008/xml/web-services-part-1-soap-vs-rest