28 lines
567 B
C#
28 lines
567 B
C#
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();
|
|
}
|
|
}
|
|
}
|