flex调用restful api的调试

用flex调用restful api的时候,显示的出错信息基本没有啥作用,比如这个:
[RPC Fault faultString="HTTP request error" faultCode="Server.Error.Request" faultDetail="Error: [IOErrorEvent type="ioError" bubbles=false cancelable=false eventPhase=2 text="Error #2032: 流错误。 URL: http://www.dev.com:3000/accounts.xml"]. URL: http://www.dev.com:3000/accounts.xml"]
    at mx.rpc::AbstractInvoker/http://www.adobe.com/2006/flex/mx/internal::faultHandler()
    at mx.rpc::Responder/fault()
    at mx.rpc::AsyncRequest/fault()
    at private::DirectHTTPMessageResponder/errorHandler()
    at flash.events::EventDispatcher/flash.events:EventDispatcher::dispatchEventFunction()
    at flash.events::EventDispatcher/dispatchEvent()
    at flash.net::URLLoader/flash.net:URLLoader::redirectEvent()
    at [io]

不由得怀念直接用rails的html页面编程时那些详细的出错信息。

其实rails把error info全都发过来了,但是flex没法处理这些文本。

所以这个时候一个http monitor就很有用了,fiddler小巧实用,http://www.fiddlertool.com/fiddler/
不过fiddler默认不能监视localhost,所以需要在host文件里面给127.0.0.1设另一个名字骗过它。

你可能感兴趣的:(编程,Flex,Flash,Rails,Adobe)