如何使用ActionScript获取响应头? (闪) [英] How to get response header using ActionScript? (Flash)

查看:203
本文介绍了如何使用ActionScript获取响应头? (闪)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

因此,我有一个网址,如www.example.com/stream /

我需要对这个网址发送任何请求并获得Http Rewspons头(像这样:

  HTTP / 1.0 200 OK 
内容类型:video / x-flv
Cache-Control:no-cache

我不需要响应body。 (如此停止从中获取数据)

如何做这样的事情(我使用Flash Builder)


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



我能想到的唯一方法是使用套接字。尽管如此,还是有一些安全相关的问题,那就是PITA。

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)

解决方案

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.

这篇关于如何使用ActionScript获取响应头? (闪)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆