phase 1
This commit is contained in:
27
ModVersionChecker/repository/api/ApiBase.cs
Normal file
27
ModVersionChecker/repository/api/ApiBase.cs
Normal file
@@ -0,0 +1,27 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace ModVersionChecker.repository.api
|
||||
{
|
||||
public class ApiBase: IDisposable
|
||||
{
|
||||
private readonly HttpClient _httpClient = new HttpClient();
|
||||
|
||||
public ApiBase()
|
||||
{
|
||||
_httpClient.Timeout = TimeSpan.FromSeconds(30);
|
||||
_httpClient.DefaultRequestHeaders.Add("User-Agent", "ModVersionChecker");
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
_httpClient?.Dispose();
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user