首页 > 技术文章 > RestSharp .net 轻量级rest客户端

wangjunwei 2015-10-09 10:27 原文

RestSharp

Simple REST and HTTP API Client for .NET

官网:http://restsharp.org/

GiHub:

https://github.com/restsharp/RestSharp

 

慢牛系列一:如何抓取股票数据

 

天气预报全能版

http://www.apix.cn/services/show/89

var client = new RestClient("http://a.apix.cn/heweather/x3/pro/weather?cityid=your_value");
var request = new RestRequest(Method.GET);
request.AddHeader("apix-key", "您的apix-key");
request.AddHeader("content-type", "application/json");
request.AddHeader("accept", "application/json");
IRestResponse response = client.Execute(request);

 

 

推荐阅读