Files
telegram-bot/modules/ContentStore/API/SomeRandomApi.cs
T

21 lines
511 B
C#
Raw Normal View History

2023-07-28 23:13:56 +03:00
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}"
))!;
}
}