AS3 - 发送POST数据到另一个域,而无需加载(沙箱安全) [英] AS3 - Sending POST data to another domain without loading (Sandbox security)
问题描述
我需要在不同的域名发送POST数据到一个ASP脚本(不加载数据)。
I need to send POST Data to a ASP script on a different domain name ( without loading data).
var scriptRequest :URLRequest = new URLRequest( 'http://someExternalCart.com/cart.asp' );
scriptRequest.method = URLRequestMethod.POST;
scriptRequest.data = scriptVars;
它与navigateToURL,在但我不希望被重定向到该网页,我只想要发送的数据。
It works with navigateToUrl, BUT I don't want to get redirected to that page, I only want to send the data.
我已经试过这样:
var ldr :URLLoader = new URLLoader();
ldr.load( scriptRequest );
不过,我收到了沙箱安全错误。
But I am getting the sandbox security error.
有没有重定向/页面重载并且无需加载(这将导致安全错误)发送数据的任何其他方式?
Is there any other way of sending the data without redirection/page reload and without loading (which causes the security error)?
推荐答案
如果您没有访问服务器添加的crossdomain.xml安全策略文件,则需要设置代理自己的服务器上通过将请求传递给你(像 http://xmlrpcflash.mattism.com/proxy_info.php)
If you don't have access to the server to add the crossdomain.xml security policy file, you will need to set up a proxy on your own server that passes the request through for you (something like http://xmlrpcflash.mattism.com/proxy_info.php).
这篇关于AS3 - 发送POST数据到另一个域,而无需加载(沙箱安全)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!