using LauncherUpdater.Function;
using System.Net.Http;
using System.Threading.Tasks;

namespace LauncherUpdater.HTTP
{
    public class HttpRequest
    {
        private readonly string _checkLauncherVersion =
            Configuration.Default.ServerIp + Configuration.Default.CheckLauncherVersion;

        public async Task<string> GetLauncherFileAsync()
        {
            string launcherFileAsync;
            using (var client = new HttpClient())
            {
                launcherFileAsync = await (await client.GetAsync(_checkLauncherVersion))
                    .Content
                    .ReadAsStringAsync();
            }

            return launcherFileAsync;
        }
    }
}