static string ExtractContentType(HttpWebResponse response) { string contentType = response.ContentType; if (String.IsNullOrEmpty(contentType)) throw MissingContentType(); return contentType.Split(';')[0]; }