Trying using JToken.ToObject generic method.
Here are the client and server code which will help you to solve this problem.
Server API Code:
public void Test(JToken users)
{
var usersArray = users.ToObject<User[]>();
}
Here is the client code I used.
string json = "[{\"UserId\":0,\"Username\":\"jj.stranger\",\"FirstName\":\"JJ\",\"LastName\":\"stranger\"}]";
HttpClient client = new HttpClient();
var result = client.PostAsync(@"http://localhost:50577/api/values/test", new StringContent(json, Encoding.UTF8, "application/json")).Result;
The object will get converted to Users array without any issues.
Do you want to build a career in Salesforce? Enroll in this Salesforce certification course to start your journey!