如果在request 的URL中写好method,则在后台执行的时候只做第一次?
如
rul = "broker/pdf.report?method=exportGECReport&format=pdf"
var downloadURL:URLRequest = new URLRequest(url);
var downLoadfile:FileReference = new FileReference();
downLoadfile.addEventListener(Event.COMPLETE, downloadCompleteHandler);
downLoadfile.download(downloadURL, defaultFileName);
在调后台方法exportGECReport 中,方法exportGECReport 只做了第一次,后面再调时没有调到。但如果改成:
var downloadURL:URLRequest = new URLRequest("broker/reports.action");
downloadURL.method = URLRequestMethod.POST;
downloadURL.data = new URLVariables();
downloadURL.data.method = "exportGECReport";
downloadURL.data.format = fileFormat;
downLoadfile = new FileReference();
downLoadfile.addEventListener(Event.COMPLETE, downloadCompleteHandler);
downLoadfile.download(downloadURL, defaultFileName);
就没有这个问题。不能在URL中写死方法,要另外加在参数中?