使用招来观察这个网址: http://opencaselist.paperlessdebate.com/bin/AllDocs?view=attachments#format=json?|t=allattachments&p=1&l=10&s=filename&d=asc获取JSON字符串的HTTP GET请求
我找到这样
我如何得到这个响应转换成字符串,我可以节省一笔可观的JSON响应在一个txt文件中使用C#?有没有办法将HTTP Web Response转换为字符串?有什么可以帮助我的NewtonSoft JSON?有没有特别的条款可以帮助我更有效地谷歌?
每次我尝试我只是在链接获取网页的HTML版本,而不是JSON数据,我试图让:
string url = "http://opencaselist.paperlessdebate.com/bin/AllDocs?view=attachments#|t=allattachments&p=1&l=10&s=filename&d=asc";
HttpWebRequest httpWebRequest = (HttpWebRequest)WebRequest.Create(url);
httpWebRequest.Method = WebRequestMethods.Http.Get;
httpWebRequest.Accept = "text/json";
httpWebRequest = (HttpWebRequest)WebRequest.Create(url);
HttpWebResponse response = (HttpWebResponse)httpWebRequest.GetResponse();
response.Close();
看看这个链接http://stackoverflow.com/questions/2108297/how-to-get-json-response-using-system-net-webrequest-in-c – Goose