Package io.vertx.httpproxy

## Interface MediaType

-     public interface MediaType

  Represent a Media type (rfc6838).
  Author:
    Julien Viet

- - ### Field Summary

    Fields
    Modifier and Type | Field | Description
    --- | --- | ---
    `static MediaType` | `ANY` |
    `static MediaType` | `APPLICATION` |
    `static MediaType` | `APPLICATION_JSON` |
    `static MediaType` | `APPLICATION_OCTET_STREAM` |
    `static MediaType` | `TEXT` |
    `static MediaType` | `TEXT_PLAIN` |

  - ### Method Summary

    All Methods Static Methods Instance Methods Abstract Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `boolean` | `accepts​(MediaType other)` |
    `String` | `parameter​(String name)` | Return a media type parameter
    `static MediaType` | `parse​(String s)` | Parse a media type.
    `static List<MediaType>` | `parseAcceptHeader​(String header)` | Parse an accept header which is a list of media types
    `String` | `subType()` |
    `String` | `type()` |

- - ### Field Detail

    - #### ANY

          static final MediaType ANY

    - #### APPLICATION

          static final MediaType APPLICATION

    - #### APPLICATION_OCTET_STREAM

          static final MediaType APPLICATION_OCTET_STREAM

    - #### APPLICATION_JSON

          static final MediaType APPLICATION_JSON

    - #### TEXT

          static final MediaType TEXT

    - #### TEXT_PLAIN

          static final MediaType TEXT_PLAIN

  - ### Method Detail

    - #### parseAcceptHeader

          static List<MediaType> parseAcceptHeader​(String header)
                                            throws IllegalArgumentException

      Parse an accept header which is a list of media types
      Parameters:
        `header` - the header
      Returns:
        the list of media types
      Throws:
        `IllegalArgumentException` - when the list is not valid

    - #### parse

          static MediaType parse​(String s)

      Parse a media type.
      Parameters:
        `s` - the string representation
      Returns:
        the parsed media type or `null` when the string to parse is not valid

    - #### type

          String type()

      Returns:
        the type or `null` when everything is matched (*)

    - #### subType

          String subType()

      Returns:
        the sub type or `null` when everything is matched (*)

    - #### accepts

          boolean accepts​(MediaType other)

      Returns:
        whether the `other` mime type is accepted

    - #### parameter

          String parameter​(String name)

      Return a media type parameter
      Parameters:
        `name` - the parameter name
      Returns:
        the value or `null`