Package org.takes.rs
Class RsWithType
- java.lang.Object
-
- org.takes.rs.RsWrap
-
- org.takes.rs.RsWithType
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
RsWithType.Html
Response decorator, with content type text/html.static class
RsWithType.Json
Response decorator, with content type application/json.static class
RsWithType.Text
Response decorator, with content type text/plain.static class
RsWithType.Xml
Response decorator, with content type text/xml.
-
Constructor Summary
Constructors Constructor Description RsWithType(Response res, CharSequence type)
Constructs aRsWithType
that will add the content type header to the response using the specified type as media type.RsWithType(Response res, CharSequence type, Charset charset)
Constructs aRsWithType
that will add the content type header to the response using the specified type as media type and the specified charset as charset parameter value.
-
-
-
Constructor Detail
-
RsWithType
public RsWithType(Response res, CharSequence type)
Constructs aRsWithType
that will add the content type header to the response using the specified type as media type.The resulting header is of type
Content-Type: media-type
.- Parameters:
res
- Original responsetype
- Content type
-
RsWithType
public RsWithType(Response res, CharSequence type, Charset charset)
Constructs aRsWithType
that will add the content type header to the response using the specified type as media type and the specified charset as charset parameter value.The resulting header is of type
Content-Type: media-type; charset=charset-value
.- Parameters:
res
- Original responsetype
- Content typecharset
- The character set to add in the content type header
-
-