Exemple #1
0
        internal static string GetContentType(this KnownContentTypes contentType)
        {
            switch (contentType)
            {
            case KnownContentTypes.Json:
                return("application/json");

            case KnownContentTypes.Xml:
                return("application/xml");
            }
            return("text/plain");
        }
Exemple #2
0
 /// <summary>
 /// Determines whether the content type is known to the serializer. This is currently not used in any meaningful way.
 /// </summary>
 /// <param name="contentType">The content type to check.</param>
 /// <returns>
 ///   <c>true</c> if the content type is known to the serializer; otherwise, false.
 /// </returns>
 public bool IsKnownContentType(String contentType)
 {
     return(KnownContentTypes.Contains(contentType));
 }