Ejemplo n.º 1
0
        public async Task <AccountGetResponse> GetAsync(AccountGetRequest request)
        {
            var data    = JsonSerializer.Serialize(request, SerializerOptions);
            var content = new StringContent(data, Encoding.UTF8, "application/json");

            var httpResponse = await HttpClient.PostAsync("/accounts/get", content);

            httpResponse.EnsureSuccessStatusCode();

            var rawResponse = await httpResponse.Content.ReadAsStringAsync();

            return(JsonSerializer.Deserialize <AccountGetResponse>(rawResponse, SerializerOptions));
        }
Ejemplo n.º 2
0
 public AccountGetResponse Get(AccountGetRequest request)
 {
     return(GetAsync(request).GetAwaiter().GetResult());
 }