User Tools

Site Tools


notes:csharp:miscellaneous

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
notes:csharp:miscellaneous [2018/09/12]
leszek [HttpClient]
notes:csharp:miscellaneous [2018/09/12] (current)
leszek [HttpClient]
Line 343: Line 343:
 using System.Net.Http;​ using System.Net.Http;​
 ... ...
-Task<​string>​ body; 
- 
-// Use the .NET Core compatible web client. 
 using (var client = new HttpClient()) using (var client = new HttpClient())
 { {
-    body = client.GetStringAsync(site);+    ​var body = client.GetStringAsync("​http://​www.wbswiki.com"​);​ 
 +    Console.WriteLine(body.Result);
 } }
- 
-Console.WriteLine(body.Result);​ 
 </​code>​ </​code>​
  
notes/csharp/miscellaneous.txt · Last modified: 2018/09/12 by leszek