Skip to content

Commit

Permalink
Replaced content.ReadAsStringAsync with content.ReadFromJsonAsync
Browse files Browse the repository at this point in the history
  • Loading branch information
gor1kartem committed Feb 24, 2025
1 parent 4789ac7 commit 8b2f1a4
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions LichessNET/API/UsersAPI.cs
Original file line number Diff line number Diff line change
@@ -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;
Expand Down Expand Up @@ -53,10 +54,9 @@ public async Task<List<UserRealTimeStatus>> GetRealTimeUserStatusAsync(IEnumerab
);

var response = await SendRequest(request);
var content = await response.Content.ReadAsStringAsync();

var userStatuses = JsonConvert.DeserializeObject<List<UserRealTimeStatus>>(content);
return userStatuses;
var content = await response.Content.ReadFromJsonAsync<List<UserRealTimeStatus>>(new JsonSerializerOptions()
{ PropertyNameCaseInsensitive = true });
return content;
}

/// <summary>
Expand Down

0 comments on commit 8b2f1a4

Please sign in to comment.