Flash 9/Flash CS 3 HTTP Post 请求Web Service by .net
import flash.display.Sprite;
import flash.net.navigateToURL;
import flash.net.URLRequest;
import flash.net.URLRequestMethod;
import flash.net.URLVariables;
import mx.rpc.*;
var myData:URLRequest = new URLRequest("http://localhost:2176/test/Service.asmx/HelloWorld");
myData.method = URLRequestMethod.POST;
var variables:URLVariables = new URLVariables("ss22=sss");
myData.data = variables;
var loader:URLLoader = new URLLoader();
loader.dataFormat = URLLoaderDataFormat.TEXT;
loader.addEventListener(Event.COMPLETE, dataOnLoad);
loader.load(myData);
function dataOnLoad(event:Event):void
{
var loader:URLLoader = URLLoader(event.target);
trace("completeHandler: " + loader.data);
}
import flash.net.navigateToURL;
import flash.net.URLRequest;
import flash.net.URLRequestMethod;
import flash.net.URLVariables;
import mx.rpc.*;
var myData:URLRequest = new URLRequest("http://localhost:2176/test/Service.asmx/HelloWorld");
myData.method = URLRequestMethod.POST;
var variables:URLVariables = new URLVariables("ss22=sss");
myData.data = variables;
var loader:URLLoader = new URLLoader();
loader.dataFormat = URLLoaderDataFormat.TEXT;
loader.addEventListener(Event.COMPLETE, dataOnLoad);
loader.load(myData);
function dataOnLoad(event:Event):void
{
var loader:URLLoader = URLLoader(event.target);
trace("completeHandler: " + loader.data);
}