Empty Content check on HttpResponseMessage
Checking HttpResponseMessage for empty content is strange since it is internal. Even a ToString() will not do what you expect. So easiest thing is the code below although there are a lot of ways to get the answer.
private static bool IsContentEmpty(HttpResponseMessage response)
{
return response.Content.GetType().Name == "EmptyContent";
}
{
return response.Content.GetType().Name == "EmptyContent";
}
Comments
Post a Comment