public static bool IsStringContent(this HttpContent content, Predicate <string> isMatch = null) { return(content.Is <StringContent>(x => { var stringContent = x.ReadAsStringAsync().Result; if (isMatch == null) { return true; } return isMatch(stringContent); })); }