Interface AcceptedMediaType


public interface AcceptedMediaType
A request-scope service that can be used by plugin request handlers to determine what media-type the server has accepted to provide to a HTTP client.

Trying to obtain this service from a plugin that is not meant to handle HTTP requests is an error.

Since:
5.4.0
  • Method Details

    • getMediaType

      MediaType getMediaType()
      Returns:
      the best media type the server can provide which is acceptable by the client for the running request.
    • isJson

      boolean isJson()
      Returns:
      true if the media type is MediaType.JSON, false otherwise.
    • isScimJson

      boolean isScimJson()
      Returns:
      true if the media type is MediaType.SCIM_JSON, false otherwise.
    • isHaapi

      boolean isHaapi()
      Returns:
      true if the media type is MediaType.HAAPI_JSON, false otherwise.
    • isHtml

      boolean isHtml()
      Returns:
      true if the media type is MediaType.HTML, false otherwise.
    • isFormUrlEncoded

      boolean isFormUrlEncoded()
      Returns:
      true if the media type is MediaType.X_WWW_FORM_URLENCODED, false otherwise.
    • isTextPlain

      boolean isTextPlain()
      Returns:
      true if the media type is MediaType.TEXT_PLAIN, false otherwise.
    • isJwt

      boolean isJwt()
      Returns:
      true if the media type is MediaType.JWT, false otherwise.