using System.Text.Json;
#if NETFRAMEWORK
using System;
using System.Net.Http;
using System.Threading;
using System.Threading.Tasks;
#endif
namespace ReC.Client
{
public class ReCClient
{
private readonly HttpClient _http;
public static readonly string ClientName = Guid.NewGuid().ToString();
public ReCClient(IHttpClientFactory httpClientFactory)
{
_http = httpClientFactory.CreateClient(ClientName);
}
///
/// POST api/RecAction/invoke/{profileId}
///
///
///
/// True if the request was successful, false otherwise
public async Task InvokeRecActionAsync(int profileId, CancellationToken cancellationToken = default)
{
var resp = await _http.PostAsync($"api/RecAction/invoke/{profileId}", content: null, cancellationToken);
return resp.IsSuccessStatusCode;
}
}
}