Reading data from an open HTTP stream

前端 未结 4 604
醉梦人生
醉梦人生 2021-02-02 16:23

I am trying to use the .NET WebRequest/WebResponse classes to access the Twitter streaming API here \"http://stream.twitter.com/spritzer.json\".

I need to b

4条回答
  •  北恋
    北恋 (楼主)
    2021-02-02 16:57

    Just use WebClient. It is designed for simple cases like this where you don't need the full power of WebRequest.

    System.Net.WebClient wc = new System.Net.WebClient();
    Console.WriteLine(wc.DownloadString("http://stream.twitter.com/spritzer.json"));
    

提交回复
热议问题