public class BytesRestResponse extends RestResponse
| Modifier and Type | Field and Description |
|---|---|
static String |
TEXT_CONTENT_TYPE |
customHeaders| Constructor and Description |
|---|
BytesRestResponse(RestChannel channel,
RestStatus status,
Throwable t) |
BytesRestResponse(RestChannel channel,
Throwable t) |
BytesRestResponse(RestStatus status) |
BytesRestResponse(RestStatus status,
String content)
Creates a new plain text response.
|
BytesRestResponse(RestStatus status,
String contentType,
byte[] content)
Creates a binary response.
|
BytesRestResponse(RestStatus status,
String contentType,
BytesReference content)
Creates a binary response.
|
BytesRestResponse(RestStatus status,
String contentType,
String content)
Creates a new plain text response.
|
BytesRestResponse(RestStatus status,
XContentBuilder builder)
Creates a new response based on
XContentBuilder. |
| Modifier and Type | Method and Description |
|---|---|
BytesReference |
content()
The response content.
|
String |
contentType()
The response content type.
|
RestStatus |
status()
The rest status code.
|
addHeader, copyHeaders, getHeaderspublic static final String TEXT_CONTENT_TYPE
public BytesRestResponse(RestStatus status)
public BytesRestResponse(RestStatus status, XContentBuilder builder)
XContentBuilder.public BytesRestResponse(RestStatus status, String content)
public BytesRestResponse(RestStatus status, String contentType, String content)
public BytesRestResponse(RestStatus status, String contentType, byte[] content)
public BytesRestResponse(RestStatus status, String contentType, BytesReference content)
public BytesRestResponse(RestChannel channel, Throwable t) throws IOException
IOExceptionpublic BytesRestResponse(RestChannel channel, RestStatus status, Throwable t) throws IOException
IOExceptionpublic String contentType()
RestResponsecontentType in class RestResponsepublic BytesReference content()
RestResponseReleasable it
should automatically be released when done by the channel sending it.content in class RestResponsepublic RestStatus status()
RestResponsestatus in class RestResponseCopyright © 2009–2016. All rights reserved.