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)); }
public AuthGetResponse Get(AuthGetRequest request) { return(GetAsync(request).GetAwaiter().GetResult()); }