24 lines
520 B
C#
24 lines
520 B
C#
using System;
|
|
using System.Net.Http;
|
|
using System.Runtime.CompilerServices;
|
|
using System.Threading.Tasks;
|
|
|
|
namespace Tech_Demo.Util
|
|
{
|
|
public class HttpUtil
|
|
{
|
|
private readonly HttpClient _httpClient = new HttpClient();
|
|
private static HttpUtil _instance;
|
|
private HttpUtil(){}
|
|
|
|
public static HttpUtil GetInstance()
|
|
{
|
|
if (_instance == null)
|
|
{
|
|
_instance = new HttpUtil();
|
|
}
|
|
|
|
return _instance;
|
|
}
|
|
}
|
|
} |