我有服务“http://deveqtradedb.lazard.com/API.aspx?action=export&entity=global”
我想从控制台应用程序的Main()函数中调用此服务
答案 0 :(得分:0)
HttpClient client = new HttpClient();
string url = "http://deveqtradedb.lazard.com/API.aspx?action=export&entity=global";
string response = client.GetStringAsync(url).Result;
进一步阅读:
答案 1 :(得分:0)
HttpWebRequest req = null;
HttpWebResponse resp = null;
string baseaddress = "http://deveqtradedb.lazard.com/API.aspx?action=export&entity=global";
req = (HttpWebRequest)WebRequest.Create(baseaddress);
req.Method = "POST";
req.ContentType = "text/xml; encoding = UTF-8";
resp = req.GetResponse() as HttpWebResponse;