MimeTypes
Assembly: ServiceStack.Text.dll
View Source
Declaration
public static class MimeTypes
Properties
IsBinaryFilter
View Source
Declaration
public static Func<string, bool?> IsBinaryFilter { get; set; }
Fields
ExtensionMimeTypes
View Source
Declaration
public static Dictionary<string, string> ExtensionMimeTypes
Utf8Suffix
View Source
Declaration
public const string Utf8Suffix = "; charset=utf-8"
Html
View Source
Declaration
public const string Html = "text/html"
HtmlUtf8
View Source
Declaration
public const string HtmlUtf8 = "text/html; charset=utf-8"
Css
View Source
Declaration
public const string Css = "text/css"
Xml
View Source
Declaration
public const string Xml = "application/xml"
XmlText
View Source
Declaration
public const string XmlText = "text/xml"
Json
View Source
Declaration
public const string Json = "application/json"
ProblemJson
View Source
Declaration
public const string ProblemJson = "application/problem+json"
JsonText
View Source
Declaration
public const string JsonText = "text/json"
Jsv
View Source
Declaration
public const string Jsv = "application/jsv"
JsvText
View Source
Declaration
public const string JsvText = "text/jsv"
Csv
View Source
Declaration
public const string Csv = "text/csv"
Pdf
View Source
Declaration
public const string Pdf = "application/pdf"
ProtoBuf
View Source
Declaration
public const string ProtoBuf = "application/x-protobuf"
JavaScript
View Source
Declaration
public const string JavaScript = "text/javascript"
WebAssembly
View Source
Declaration
public const string WebAssembly = "application/wasm"
Jar
View Source
Declaration
public const string Jar = "application/java-archive"
Dmg
View Source
Declaration
public const string Dmg = "application/x-apple-diskimage"
Pkg
View Source
Declaration
public const string Pkg = "application/x-newton-compatible-pkg"
FormUrlEncoded
View Source
Declaration
public const string FormUrlEncoded = "application/x-www-form-urlencoded"
MultiPartFormData
View Source
Declaration
public const string MultiPartFormData = "multipart/form-data"
JsonReport
View Source
Declaration
public const string JsonReport = "text/jsonreport"
Soap11
View Source
Declaration
public const string Soap11 = "text/xml; charset=utf-8"
Soap12
View Source
Declaration
public const string Soap12 = "application/soap+xml"
Yaml
View Source
Declaration
public const string Yaml = "application/yaml"
YamlText
View Source
Declaration
public const string YamlText = "text/yaml"
PlainText
View Source
Declaration
public const string PlainText = "text/plain"
MarkdownText
View Source
Declaration
public const string MarkdownText = "text/markdown"
MsgPack
View Source
Declaration
public const string MsgPack = "application/x-msgpack"
Wire
View Source
Declaration
public const string Wire = "application/x-wire"
Compressed
View Source
Declaration
public const string Compressed = "application/x-compressed"
NetSerializer
View Source
Declaration
public const string NetSerializer = "application/x-netserializer"
Excel
View Source
Declaration
public const string Excel = "application/excel"
MsWord
View Source
Declaration
public const string MsWord = "application/msword"
Cert
View Source
Declaration
public const string Cert = "application/x-x509-ca-cert"
ImagePng
View Source
Declaration
public const string ImagePng = "image/png"
ImageGif
View Source
Declaration
public const string ImageGif = "image/gif"
ImageJpg
View Source
Declaration
public const string ImageJpg = "image/jpeg"
ImageSvg
View Source
Declaration
public const string ImageSvg = "image/svg+xml"
Bson
View Source
Declaration
public const string Bson = "application/bson"
Binary
View Source
Declaration
public const string Binary = "application/octet-stream"
ServerSentEvents
View Source
Declaration
public const string ServerSentEvents = "text/event-stream"
Methods
GetExtension(String)
View Source
Declaration
public static string GetExtension(string mimeType)
Returns
System.String
Parameters
Type | Name |
---|---|
System.String | mimeType |
GetRealContentType(String)
View Source
Declaration
public static string GetRealContentType(string contentType)
Returns
System.String
Parameters
Type | Name |
---|---|
System.String | contentType |
MatchesContentType(String, String)
Case-insensitive, trimmed compare of two content types from start to ';', i.e. without charset suffix
View Source
Declaration
public static bool MatchesContentType(string contentType, string matchesContentType)
Returns
System.Boolean
Parameters
Type | Name |
---|---|
System.String | contentType |
System.String | matchesContentType |
IsBinary(String)
View Source
Declaration
public static bool IsBinary(string contentType)
Returns
System.Boolean
Parameters
Type | Name |
---|---|
System.String | contentType |
GetMimeType(String)
View Source
Declaration
public static string GetMimeType(string fileNameOrExt)
Returns
System.String
Parameters
Type | Name |
---|---|
System.String | fileNameOrExt |