We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 8352dbd commit 6ede4d2Copy full SHA for 6ede4d2
RestSharp/RestClient.cs
@@ -476,12 +476,12 @@ private static IEnumerable<Parameter> GetQueryStringParameters(IRestRequest requ
476
477
private Func<IDeserializer> GetHandler(string contentType)
478
{
479
- if (contentType == null)
480
- throw new ArgumentNullException(nameof(contentType));
481
-
482
- if (string.IsNullOrEmpty(contentType) && ContentHandlers.ContainsKey("*"))
+ if (contentType.IsEmpty() && ContentHandlers.ContainsKey("*"))
483
return ContentHandlers["*"];
484
+ if (ContentHandlers.Keys.Count == 1)
+ return ContentHandlers.First().Value;
+
485
int semicolonIndex = contentType.IndexOf(';');
486
487
if (semicolonIndex > -1)
0 commit comments