28 lines
576 B
C#
28 lines
576 B
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Threading.Tasks;
|
|
using System.Net.Http;
|
|
|
|
|
|
namespace TaskRunner
|
|
{
|
|
public class ServerApi
|
|
{
|
|
public Uri serverUri;
|
|
private readonly HttpClient client = new HttpClient();
|
|
|
|
public ServerApi(Uri serverUri)
|
|
{
|
|
this.serverUri = serverUri;
|
|
client.BaseAddress = serverUri;
|
|
}
|
|
|
|
public async Task<string> GetTask()
|
|
{
|
|
var resp = await client.GetStringAsync("get");
|
|
return resp;
|
|
}
|
|
}
|
|
}
|