MIMEType

public struct MIMEType

Allows MIME types to be declared statically at compile-time, enabling them to be referenced in a non-stringly way.

  • A String representation of the MIMEType.

    Declaration

    Swift

    public let rawValue: String
  • Constructs a new MIMEType using the given string.

    Declaration

    Swift

    public init(_ type: StaticString)

    Parameters

    type

    StaticString containing the MIME type string.

  • Represents the MIME type `application/x-www-form-urlencoded`.

    Declaration

    Swift

    public static let urlFormEncoded    = MIMEType("application/x-www-form-urlencoded")
  • Represents the MIME type `application/json`.

    Declaration

    Swift

    public static let json              = MIMEType("application/json")