How to get response header using ActionScript? (Flash)

守給你的承諾、 提交于 2019-12-22 12:23:47

问题


So... I have a URL like www.example.com/stream/

I need to make any request to this url and get Http Rewspons header (like this one:

HTTP/1.0 200 OK
Content-type: video/x-flv
Cache-Control: no-cache

I do not need reponse body at all. After I get header need to emmidiatly close connection to that url (so stop to obtain data from it)

How to do such thing (I use Flash builder)


回答1:


Aparently, that's possible in AIR (I've never tried it):

http://livedocs.adobe.com/flash/9.0/ActionScriptLangRefV3/flash/net/URLStream.html#event:httpResponseStatus

The only other way I can think of is using a Socket directly. It's more involved though, and there are some security related issues that are a PITA.



来源:https://stackoverflow.com/questions/2733853/how-to-get-response-header-using-actionscript-flash

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!