【发布时间】:2019-10-25 16:31:51
【问题描述】:
我的查询字符串中有参数,所以我需要像下面给定的 url 一样传递
URL + ?dd={{Some Json Data}}&accessKey=ddfr54r5g5r
WebClient webClient = new WebClient();
webClient.Headers.Add("user-agent", "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.2; .NET CLR 1.0.3705;)");
string url = "URL + ?dd={{Some Json Data}}&accessKey=ddfr54r5g5r";
var jsonData = webClient.DownloadData(url);
DataContractJsonSerializer ser = new DataContractJsonSerializer(typeof(RootObject));
RootObject obj = new RootObject();
obj = (RootObject)ser.ReadObject(new MemoryStream(jsonData));
谁能分享一些适用于您的 API 的方法。
【问题讨论】:
标签: c# api web console-application call