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";
}


Comments

Popular posts from this blog

Upgrading to .NET8 from desktop versions 4.8.X

GHL Chat Bots for Webpage

GHL > Set website so shorter URL address