我正在尝试将三个参数(arg1、arg2 和 arg3)传递给 CGI 脚本,但以下代码不起作用。
有人可以告诉我如何使用 flex 将参数传递给 CGI 脚本吗?
public function loadURL():void {
//frameBuffer.reloadFrame(frameBuffer.currentFrame);
var variables:URLVariables = new URLVariables("name=Franklin");
var request:URLRequest = new URLRequest();
request.url = "http://firefly.cs.missouri.edu/cgi-bin/main2.cgi?arg1=image.TIF&arg2=BranchPoints.txt&arg3=Medial.txt";
request.method = URLRequestMethod.POST;
request.data = variables;
var loader:URLLoader = new URLLoader();
loader.dataFormat = URLLoaderDataFormat.VARIABLES;
loader.addEventListener(Event.COMPLETE, completeHandler);
try
{
loader.load(request);
}
catch (error:Error)
{
trace("Unable to load URL");
}
function completeHandler(event:Event):void
{
trace(event.target.data.welcomeMessage);
}
//Alert.show("Hi");
}