Skip to content

Commit 9913432

Browse files
Support json with arrays on DetectContentType. (#1709)
1 parent 83c5c3b commit 9913432

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/RestSharp/RestClient.Serialization.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,6 @@ internal RestResponse<T> Deserialize<T>(RestRequest request, RestResponse raw) {
9696
return factory?.GetSerializer().Deserializer;
9797

9898
string? DetectContentType()
99-
=> response.Content!.StartsWith("<") ? ContentType.Xml : response.Content.StartsWith("{") ? ContentType.Json : null;
99+
=> response.Content!.StartsWith("<") ? ContentType.Xml : response.Content.StartsWith("{") || response.Content.StartsWith("[") ? ContentType.Json : null;
100100
}
101-
}
101+
}

0 commit comments

Comments
 (0)