答案 0 :(得分:1)
答案 1 :(得分:1)
答案 2 :(得分:1)
这是对John Ballinger的答案的回应:
import flash.net.URLLoader;
import flash.net.URLRequest;
import flash.net.URLRequestHeader;
var loader:URLLoader = new URLLoader();
var request:URLRequest = new URLRequest("http://www.mydomain.com/myapp.php");
var header:URLRequestHeader = new URLRequestHeader("custom-header-name", "value");
request.requestHeaders.push(header);
try {
loader.load(request);
} catch (error:Error) {
trace("Unable to load requested document.");
}
您还必须确保修改crossdomain.xml以允许http标头,如下所示:
<!DOCTYPE cross-domain-policy SYSTEM "http://www.adobe.com/xml/dtds/cross-domain-policy.dtd">
<cross-domain-policy>
<allow-access-from domain="*.mydomain.com" />
<allow-http-request-headers-from domain="*.mydomain.com" headers="*" />
</cross-domain-policy>
答案 3 :(得分:0)