mirror of
https://github.com/xoofx/markdig.git
synced 2026-11-16 17:30:52 +00:00
use await for http client
This commit is contained in:
@@ -4,17 +4,16 @@ using System.Diagnostics;
|
||||
using System.IO;
|
||||
using System.Net.Http;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace UnicodeNormDApp
|
||||
{
|
||||
class Program
|
||||
{
|
||||
static void Main(string[] args)
|
||||
static async Task Main(string[] args)
|
||||
{
|
||||
using var httpClient = new HttpClient();
|
||||
using var response = httpClient.GetAsync("http://www.unicode.org/Public/UCD/latest/ucd/NormalizationTest.txt").Result;
|
||||
using var content = response.Content;
|
||||
var data = content.ReadAsStringAsync().Result;
|
||||
var data = await httpClient.GetStringAsync("http://www.unicode.org/Public/UCD/latest/ucd/NormalizationTest.txt");
|
||||
|
||||
var stringReader = new StringReader(data);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user