Forum: Ruby HTTP IO??

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
81cf8dab4b4af8aa3148c28421afd845?d=identicon&s=25 hsanson (Guest)
on 2005-11-16 06:58
(Received via mailing list)
I am developing a streaming client in ruby, so far so good... now I am
trying
to get Net::HTTP to behave like an IO with no luck. I need Net::HTTP to
read
the headers as it usually does but stop at before reading the body of
the
page so I can read the stream in chunks and feed them to the player.

I read this article

http://redhanded.hobix.com/inspect/theStoryOfStrea...

but I can't get it to work.

any help is appreciated.....

Horacio
5befe95e6648daec3dd5728cd36602d0?d=identicon&s=25 bob.news (Guest)
on 2005-11-16 11:38
(Received via mailing list)
Horacio Sanson wrote:
> I am developing a streaming client in ruby, so far so good... now I
> am trying to get Net::HTTP to behave like an IO with no luck. I need
> Net::HTTP to read the headers as it usually does but stop at before
> reading the body of the page so I can read the stream in chunks and
> feed them to the player.
>
> I read this article
>
>
http://redhanded.hobix.com/inspect/theStoryOfStrea...
>
> but I can't get it to work.
>
> any help is appreciated.....

open-uri can help you - although you won't see headers

>> require 'open-uri'
=> true
>> open("http://www.google.com/index.html") {|io| p io.read }

Kind regards

    robert
This topic is locked and can not be replied to.