(* read http-link line by line and print to console *) open System open System . Net open System . IO open System . Text let mutable enc = Encoding . GetEncoding ( 1251 ) let http ( url : string ) = seq { let req = HttpWebRequest . CreateHttp ( url ) let res = req . GetResponse () use stream = new StreamReader ( res . GetResponseStream (), enc ) while not stream . EndOfStream do let line = stream . ReadLine () if not ( isNull line ) then yield line } let print ( url : string ) = for line in http ( url ) do printfn "%s" line print ( "http://www.amic.ru" )
t.me/perfect0sight