FSLIB.NETWORK 是一款开源HTTP的高性能高易用性网络库,是对HttpWebRequest/HttpWebResponse的包装,目的是为了用起来更简单明了。设计的时候就为了提供更高的可用性和扩展性。每天由它发现的请求数过亿。
源码:https://github.com/iccfish/fslib.network
作者:https://www.fishlee.net/
HttpClient client = new HttpClient();
string html = client.GetStringResultAsync("https://www.baidu.com").Result;
client.GetImageResultAsync("https://ss0.bdstatic.com/5aV1bjqh_Q23odCf/static/superman/img/logo/bd_logo1_31bdc765.png").Result.Save("c:\\baidu1.png");
File.WriteAllBytes("c:\\abc.pdf", client.GetDataResultAsync("http://www.hrdchina.org/images/huiyuan_fuwuye.pdf").Result);
string html = client.GetStringResultAsync("https://www.baidu.com/s", new { wd="中国健康医学教育网",ie="utf-8" }).Result
client.ImportCookies("cookie content",new Uri("https://www.baidu.com"));