参考调用接口教程网址:
https://tushare.pro/document/1?doc_id=130
要求:使用该网址中给出的例子,用C#获取数据,给出实现demo
参考调用接口教程网址:
https://tushare.pro/document/1?doc_id=130
要求:使用该网址中给出的例子,用C#获取数据,给出实现demo
控制台程序。提取出json数据
using System;
using System.Net;
using System.Text;
using System.Text.RegularExpressions;
namespace ConsoleApp1
{
class Program
{
static void Main(string[] args)
{
WebClient http = new WebClient();
string url,postdata, Responsetext;
url ="http://api.tushare.pro/";
postdata = @"{""api_name"": ""stock_basic"", ""token"": ""a8eac410fa91c8b222d95a7ee8347338bbfc1566a5f314d963a9ef3a"", ""params"": {""list_stauts"":""L""}, ""fields"": ""ts_code,name,area,industry,list_date""}";
http.Headers.Set(HttpRequestHeader.ContentType, "application/x-www-form-urlencoded");
http.Encoding = Encoding.UTF8;
Responsetext = Regex.Unescape(http.UploadString(url, postdata));
Console.Write(Responsetext);
Console.ReadKey();
}
}
}