var request:URLRequest = new URLRequest(); var loader:URLLoader = new URLLoader(); loader.addEventListener(Event.COMPLETE, resultHandler); loader.addEventListener(IOErrorEvent.IO_ERROR, errorHandler); loader.addEventListener(HTTPStatusEvent.HTTP_STATUS,httpStatusHandler); request.url = "http://rails/view/resource"; // Set the request type as POST and send the DELETE command as // a variable in the data of the request request.method = URLRequestMethod.POST; request.data._method = "DELETE"; loader.load(request);
Ror(Ruby on Rails,一种web 敏捷开发框架)在正确的HTTP 方法不能被使用的时候,允许_methdo 变量来申明描述的方法。对于其他类型的REST 类服务,类似的操作都会被使用到。