From 8b2f1a4f15341c65cfa29cd6ddfe46e26ce6232a Mon Sep 17 00:00:00 2001 From: gor1kartem Date: Mon, 24 Feb 2025 19:10:36 +0300 Subject: [PATCH] Replaced content.ReadAsStringAsync with content.ReadFromJsonAsync --- LichessNET/API/UsersAPI.cs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/LichessNET/API/UsersAPI.cs b/LichessNET/API/UsersAPI.cs index c3b2d00..080417a 100644 --- a/LichessNET/API/UsersAPI.cs +++ b/LichessNET/API/UsersAPI.cs @@ -1,4 +1,5 @@ using System.Net.Http.Json; +using System.Text.Json; using LichessNET.Entities.Account.Performance; using LichessNET.Entities.Enumerations; using LichessNET.Entities.Social; @@ -53,10 +54,9 @@ public async Task> GetRealTimeUserStatusAsync(IEnumerab ); var response = await SendRequest(request); - var content = await response.Content.ReadAsStringAsync(); - - var userStatuses = JsonConvert.DeserializeObject>(content); - return userStatuses; + var content = await response.Content.ReadFromJsonAsync>(new JsonSerializerOptions() + { PropertyNameCaseInsensitive = true }); + return content; } ///