Actionscript 3 Actionscript 3读取响应内容类型

Actionscript 3 Actionscript 3读取响应内容类型,actionscript-3,flash,http,bulkloader,urlloader,Actionscript 3,Flash,Http,Bulkloader,Urlloader,是否可以使用Actionscript 3中的URLLoader类读取web服务器响应的原始内容类型?我们正在通过http接收自我描述消息: HTTP/1.1 200 OK Cache-Control: max-age=0, private, must-revalidate Content-Type: application/x-protobuf; desc="http://domain.herokuapp.com/pb_message.desc"; messageType="SomeApp.Y

是否可以使用Actionscript 3中的URLLoader类读取web服务器响应的原始内容类型?我们正在通过http接收自我描述消息:

HTTP/1.1 200 OK 
Cache-Control: max-age=0, private, must-revalidate
Content-Type: application/x-protobuf; desc="http://domain.herokuapp.com/pb_message.desc"; messageType="SomeApp.YourCustomClass"; delimited=true; charset=utf-8
Date: Sat, 06 Apr 2013 23:16:07 GMT
Etag: "d27199cd1500953f6f4512c76bc58f28"
Server: WEBrick/1.3.1 (Ruby/1.9.2/2011-07-09)
X-Rack-Cache: miss
X-Request-Id: 57e83c24a04a03959eeed4ca0d3ab961
X-Runtime: 0.044153
Content-Length: 13
Connection: keep-alive
上面的示例将对象显示为protobuf类型,desc属性是对象描述的url,messageType是具有相应对象类的应用程序名称


我希望能够读取messageType参数。

您可以通过在URLLoader上侦听HTTPStatusEvent来检索响应信息:

myLoader.addEventListener(HTTPStatusEvent.HTTP_RESPONSE_STATUS, httpHandler);

function httpHandler(event:HTTPStatusEvent):void
{
    for each (var object:Object in event.responseHeaders)
    {
    trace(object.name+" : "+object.value);
    }
}

信息在事件中存储为对象数组,具有名称和值属性。responseHeaders

@Lee Burrows是正确的。然而,这些似乎只适用于空气应用。 见:


如果能够在flash运行时找到解决方案,那就太好了

以上文章中的内容是否会导致返回为空?我现在把@作为概念的证明,而m_负责人仍然以空阵列的形式回来这只适用于空中应用。普通闪存应用程序无法读取标题。