【发布时间】:2016-11-30 11:48:42
【问题描述】:
我正在调用一个返回 json 的 REST 服务
这是我目前所拥有的
HttpClient client = CreateClient(this.url, this.username, this.password);
string data_json = Newtonsoft.Json.JsonConvert.SerializeObject(Detail, Newtonsoft.Json.Formatting.Indented);
//Detail is a class with the json data
HttpResponseMessage response = client.GetAsync(uri).Result;
result = response.Content.ReadAsStringAsync().Result;
现在,我该如何使用data_json?我需要传递 json 来获得响应。
【问题讨论】:
-
在帖子正文中传递?