Files
telegram-bot/modules/ContentStore/API/SomeRandomApi.cs
T
2023-07-28 23:14:05 +03:00

21 lines
511 B
C#

using System.Net.Http.Json;
using West.TelegramBot.ContentStore.Model;
namespace West.TelegramBot.ContentStore.API;
public class SomeRandomApi : ISomeRandomApi
{
private readonly HttpClient _client;
public SomeRandomApi(HttpClient client)
{
_client = client;
}
public async Task<SomeRandomApiAnimalResponse> GetAnimalAsync(string animalId)
{
return (await _client.GetFromJsonAsync<SomeRandomApiAnimalResponse>(
$"animal/{animalId}"
))!;
}
}