mirror of
https://github.com/KevinWG/OSS.Tools.git
synced 2026-10-23 02:00:51 +08:00
29 lines
640 B
C#
29 lines
640 B
C#
using System;
|
|
using System.Net.Http;
|
|
using OSS.Http.Mos;
|
|
|
|
namespace OSS.Http.Test
|
|
{
|
|
class Program
|
|
{
|
|
private static void Main(string[] args)
|
|
{
|
|
var req = new OsHttpRequest();
|
|
|
|
req.Uri = new Uri("http://www.baidu.com");
|
|
|
|
var result = req.RestSend();
|
|
result.Wait();
|
|
var content = result.Result.Content.ReadAsStringAsync();
|
|
content.Wait();
|
|
Console.WriteLine(content.Result);
|
|
Console.Read();
|
|
|
|
|
|
var client = new HttpClient();
|
|
var resTask = client.GetAsync("http://www.baidu.com");
|
|
|
|
}
|
|
}
|
|
}
|