コード例 #1
0
        /// <summary>
        /// Checks whether a given content type is valid as a content type for resource data
        /// </summary>
        /// <param name="contentType">The content type, as it appears on e.g. a Http Content-Type header</param>
        /// <returns></returns>
        public static bool IsValidResourceContentType(string contentType)
        {
            var f = ContentType.GetMediaTypeFromHeaderValue(contentType);

            return(JSON_CONTENT_HEADERS.Contains(f) || XML_CONTENT_HEADERS.Contains(f));
        }