1
当试图向ASP.NET asmx Web服务发送POST请求时,我看到(在Charles和Firebug中)它以GET的形式发送。AS3 POST请求作为GET发送
这里是我的AS3
public function save(page:SharedPageVO, callback :Function = null): void {
var req:URLRequest = new URLRequest("service.asmx/CreateSharedPage");
req.data = page;
req.method = URLRequestMethod.POST;
if (callback != null)
{
//handle removing the event here instead of there
this.complete = callback;
DataService.instance.addEventListener(Event.COMPLETE, onComplete);
}
DataService.instance.load(req);
}
public var complete:Function;
private function onComplete(e:Event)
{
if (complete != null) complete(e);
complete = null;
DataService.instance.removeEventListener(onComplete);
}
这似乎与闪光灯,因为它正在发生的事情甚至去到服务器之前的一个问题。我已经将这个上传到测试服务器,我仍然看到它通过GET。任何帮助,将不胜感激。谢谢。
你的表格定义了一个body,对吧?从[URLRequest](http://www.adobe.com/livedocs/flash/9.0/ActionScriptLangRefV3/flash/net/URLRequest.html#method)文档:“注意:如果在Flash Player中运行并且引用的表单没有正文,即使该方法设置为URLRequestMethod.POST,Flash Player也会自动使用GET操作。“ – Stephen 2010-08-24 14:08:42
谢谢Stephen,就是这样。 – Skawful 2010-08-24 15:21:38