AS3 - 无需加载即可将 POST 数据发送到另一个域(沙盒安全性) [英] AS3 - Sending POST data to another domain without loading (Sandbox security)

查看:13
本文介绍了AS3 - 无需加载即可将 POST 数据发送到另一个域(沙盒安全性)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要将 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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆