Interface ContentType


public interface ContentType
A parsed Content-Type header value.
Since:
7.33
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Interface
    Description
    static final class 
    A builder of ContentType.
  • Method Summary

    Modifier and Type
    Method
    Description
    default Optional<String>
    Returns the boundary specified in the Content-Type header or an empty Optional if the header does not contain a boundary.
    default Optional<String>
    Returns the charset specified in the Content-Type header or an empty Optional if the header does not contain a charset.
    default String
    Returns the media type (the MIME type) specified in the Content-Type header.
    newBuilder(String mediaType)
    Create a new ContentType builder.
  • Method Details

    • newBuilder

      static ContentType.Builder newBuilder(String mediaType)
      Create a new ContentType builder.
    • mediaType

      default String mediaType()
      Returns the media type (the MIME type) specified in the Content-Type header.
    • charset

      default Optional<String> charset()
      Returns the charset specified in the Content-Type header or an empty Optional if the header does not contain a charset.
    • boundary

      default Optional<String> boundary()
      Returns the boundary specified in the Content-Type header or an empty Optional if the header does not contain a boundary.