Consume a StreamReader stream .NET from a web request as it streams?

房东的猫 提交于 2019-12-05 15:15:12

One remark upfront: The leaveOpen parameter you saw is only present in .NET 4.5 and up

As to how to deal with the Twitter streaming API:

The above links lead you to opensource libraries and documentation on how to access the Twitter API (both the streaming API and the REST API) with .NET / C#.

Use StreamReader's buffer to feed received bytes to (Encoding.UTF8.GetString) then append them to a StringBuilder to get received the stream as string.

Use ToString of StringBuilder

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