flex HTTPService浅析
来源:互联网 发布:经营业绩怎么写数据 编辑:程序博客网 时间:2024/05/16 18:39
HTTPService是一种前后台交互技术。
用于获取后台返回数据或者传递参数给后台,后台经过处理返回数据。对于flex返回的数据经常用xml格式。
这里有一个封装好的示例,正常加载返回方法resultFunction,异常返回方法faultFunction
public function doRestCall(url:String, resultFunction:Function, faultFunction:Function=null, restMethod:String='GET', parms:Object=null):void { var thttpService:HTTPService=new HTTPService(); thttpService.method=restMethod; thttpService.url=url; thttpService.resultFormat = 'e4x'; thttpService.addEventListener(ResultEvent.RESULT, resultFunction); if (faultFunction != null) { thttpService.addEventListener(FaultEvent.FAULT, faultFunction); } thttpService.send(parms); thttpService.disconnect(); }
restMethod:传递方式。
parms:需要传递的参数。(有待后续研究)
其实简易方式可以这样写:
if(httpService==null) { httpService=new HTTPService(); httpService.useProxy=false; httpService.method="POST"; httpService.resultFormat="e4x"; httpService.addEventListener(ResultEvent.RESULT,ShowMsgResult); httpService.addEventListener(FaultEvent.FAULT,httpFault); } httpService.url=UpLoadUrl+"?contractid="+contractno+"&pcid="+pcid+"&operate=delete&filefolder="+encodeURIComponent(path); httpService.send();
备注
*技术交流与合作:QQ: 791663094;Email:kong.yee@foxmail.com
0 0
- flex HTTPService浅析
- Flex HttpService
- Flex HTTPService
- flex---->HttpService
- Flex HTTPService
- Flex HTTPService
- Flex HTTPService 提交表单
- Flex HTTPService初识
- Flex JSP with HttpService
- FLEX与HttpService通信
- flex HttpService请求
- Flex的HttpService的写法
- Flex HTTPService 跨域访问
- Flex: 使用HTTPService获取数据
- 关于FLEX HTTPService重发问题
- flex httpservice timer循环请求
- Flex HTTPService 跨域访问
- Flex HTTPService 跨域访问
- VC 防火墙的操作例子
- Android仿搜狗浏览器加载动画
- HTTP协议笔记
- nmealib代码分析
- Java学习笔记(42)----------HashTable,HashMap和HashSet
- flex HTTPService浅析
- 提高android数据库性能,GreenDao初步使用
- 电脑插入耳机无声音,显示AMD HDMI OUTPUT未插入,但是外放有声音故障解决方案
- 用户空间与内核空间数据交换的方式------seq_file
- UIImageView添加阴影和边框
- uva 10055
- hello world
- Java学习笔记(44)----------探索equals()和hashCode()方法
- linux下使用mysql数据库的总结