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

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

            httpResponse.EnsureSuccessStatusCode();

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

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