public class RestResponse
extends HTTPResponse
Modifier and Type | Field and Description |
---|---|
static String |
DEFAULT_ENCODING
Default content encoding for Rest response.
|
Constructor and Description |
---|
RestResponse(String status,
String mimeType,
InputStream data)
Creates a new REST response.
|
RestResponse(String status,
String mimeType,
String text)
Creates a new REST response.
|
RestResponse(String status,
String mimeType,
String text,
String encoding)
Creates a new REST response.
|
public static final String DEFAULT_ENCODING
public RestResponse(String status, String mimeType, InputStream data)
status
- the response status.mimeType
- the response MIME typedata
- the data to send.HTTPConstants#HTTP_STATUS_BADREQUEST
,
HTTPConstants#HTTP_STATUS_FORBIDDEN
,
HTTPConstants#HTTP_STATUS_INTERNALERROR
,
HTTPConstants#HTTP_STATUS_MEDIA_TYPE
,
HTTPConstants#HTTP_STATUS_METHOD
,
HTTPConstants#HTTP_STATUS_NOTACCEPTABLE
,
HTTPConstants#HTTP_STATUS_NOTFOUND
,
HTTPConstants#HTTP_STATUS_NOTIMPLEMENTED
,
HTTPConstants#HTTP_STATUS_NOTMODIFIED
,
HTTPConstants#HTTP_STATUS_OK
,
HTTPConstants#HTTP_STATUS_REDIRECT
public RestResponse(String status, String mimeType, String text) throws UnsupportedEncodingException
status
- the response status.mimeType
- the response MIME typetext
- the data to send, using default encoding.UnsupportedEncodingException
- if default encoding is not supported.DEFAULT_ENCODING
,
HTTPConstants#HTTP_STATUS_BADREQUEST
,
HTTPConstants#HTTP_STATUS_FORBIDDEN
,
HTTPConstants#HTTP_STATUS_INTERNALERROR
,
HTTPConstants#HTTP_STATUS_MEDIA_TYPE
,
HTTPConstants#HTTP_STATUS_METHOD
,
HTTPConstants#HTTP_STATUS_NOTACCEPTABLE
,
HTTPConstants#HTTP_STATUS_NOTFOUND
,
HTTPConstants#HTTP_STATUS_NOTIMPLEMENTED
,
HTTPConstants#HTTP_STATUS_NOTMODIFIED
,
HTTPConstants#HTTP_STATUS_OK
,
HTTPConstants#HTTP_STATUS_REDIRECT
public RestResponse(String status, String mimeType, String text, String encoding) throws UnsupportedEncodingException
status
- the response status.mimeType
- the response MIME typetext
- the data to send.encoding
- the data encoding.UnsupportedEncodingException
- if given data encoding is not supported.HTTPConstants#HTTP_STATUS_BADREQUEST
,
HTTPConstants#HTTP_STATUS_FORBIDDEN
,
HTTPConstants#HTTP_STATUS_INTERNALERROR
,
HTTPConstants#HTTP_STATUS_MEDIA_TYPE
,
HTTPConstants#HTTP_STATUS_METHOD
,
HTTPConstants#HTTP_STATUS_NOTACCEPTABLE
,
HTTPConstants#HTTP_STATUS_NOTFOUND
,
HTTPConstants#HTTP_STATUS_NOTIMPLEMENTED
,
HTTPConstants#HTTP_STATUS_NOTMODIFIED
,
HTTPConstants#HTTP_STATUS_OK
,
HTTPConstants#HTTP_STATUS_REDIRECT