AS3 POST请求发送一个GET [英] AS3 POST Request sending as a GET
问题描述
当试图发送一个POST请求到ASP.NET ASMX web服务我看到(在查尔斯和萤火虫),它通过一个GET。
When trying to send a POST request to an ASP.NET asmx web service I am seeing (in Charles and Firebug) it go through as a 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。任何帮助将是AP preciated。谢谢你。
This seems to be an issue with flash as it is happening before it even goes to the server. I have uploaded this to a testing server and I still see it come through as a GET. Any help would be appreciated. Thanks.
推荐答案
从动作LR(URLRequest类,方法,属性):
From actionscript LR (URLRequest class, method property):
请注意:如果在Flash Player和引用的形式运行没有正文,Flash Player会自动使用GET操作,即使该方法被设置为URLRequestMethod.POST。出于这个原因,建议始终包括一个虚拟的身体,以确保正确的方法被使用。
Note: If running in Flash Player and the referenced form has no body, Flash Player automatically uses a GET operation, even if the method is set to URLRequestMethod.POST. For this reason, it is recommended to always include a "dummy" body to ensure that the correct method is used.
您使用虚拟的身体?
这篇关于AS3 POST请求发送一个GET的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!