如何给json接口的数据传参数
HttpWebRequest request = (HttpWebRequest)WebRequest.Create("http://119.164.57.222/xk_yun/action/Output/list2/");
request.Method = "get";
request.Headers.Add(string.Format("Authorization: c={0}",2));
HttpWebResponse response = (HttpWebResponse)request.GetResponse();
StreamReader sr = null;
sr = new StreamReader(response.GetResponseStream(), Encoding.UTF8);
string json = sr.ReadToEnd();
v2 = JsonConvert.DeserializeObject<List<Vo2>>(json);
sr.Close();
response.Close();
分类为2;
我想取出接口中指定分类的数据怎么取?
------解决方案--------------------本帖最后由 net_lover 于 2013-05-13 19:25:15 编辑
request.Headers["Authorization"];
你发方法为get请求,可以把参数放在url中,你要是放在request.Headers中,可以使用request.Headers["Authorization"];得到