Package org.takes.rs

Class RsWithType.Json

  • All Implemented Interfaces:
    Body, Head, Response
    Enclosing class:
    RsWithType

    public static final class RsWithType.Json
    extends RsWrap
    Response decorator, with content type application/json.

    The class is immutable and thread-safe.

    Since:
    0.30
    • Constructor Detail

      • Json

        public Json​(Response res)
        Constructs a JSON that will add application/json as the content type header to the response.
        Parameters:
        res - Original response
      • Json

        public Json​(Response res,
                    Charset charset)
        Constructs a JSON that will add application/json as the content type header to the response using the specified charset as charset parameter value.
        Parameters:
        res - Original response
        charset - The character set to add in the content type header