首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 网站开发 > Flash >

flash AS2 发送HTTP请求如何添加“请求数据”

2012-11-10 
flash AS2 发送HTTP请求怎么添加“请求数据”?GET / HTTP/1.1Referer: http://www.baidu.comx-flash-version

flash AS2 发送HTTP请求怎么添加“请求数据”?
GET / HTTP/1.1
Referer: http://www.baidu.com
x-flash-version: 8,0,22,0
Content-Type: application/x-www-form-urlencoded
Content-Length: 0
User-Agent: Shockwave Flash
Host: www.baidu.com
Cache-Control: no-cache
Cookie: BAIDUID=28288282
ABCDEFGABCDEFG


很简单的问题:AS中怎么在请求上加上最后的“ABCDEFGABCDEFG”?

(书上只说了怎么添加标头和请求行,网上找了很久都没找到答案,于是就来问了)

请教各位!

[解决办法]

Java code
//actionscript codevar loader:URLLoader = new URLLoader();//声明一个URLRequestvar url:URLRequest = new URLRequest("test.php");//设置传输方式为POSTurl.method = URLRequestMethod.POST;//声明一个URLVariablesvar values:URLVariables = new URLVariables();//设置要传输的信息values.message="hello im flash!";url.data = values;loader.addEventListener(Event.COMPLETE,loaded);function loaded(e:Event){trace(loader.data);// output : this is flash say:hello im flash!}loader.load(url); 

热点排行