public class BytesRestResponse extends RestResponse
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
TEXT_CONTENT_TYPE |
customHeaders| Constructor and Description |
|---|
BytesRestResponse(RestChannel channel,
java.lang.Exception e) |
BytesRestResponse(RestChannel channel,
RestStatus status,
java.lang.Exception e) |
BytesRestResponse(RestStatus status,
java.lang.String content)
Creates a new plain text response.
|
BytesRestResponse(RestStatus status,
java.lang.String contentType,
byte[] content)
Creates a binary response.
|
BytesRestResponse(RestStatus status,
java.lang.String contentType,
BytesReference content)
Creates a binary response.
|
BytesRestResponse(RestStatus status,
java.lang.String contentType,
java.lang.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.
|
java.lang.String |
contentType()
The response content type.
|
static ElasticsearchStatusException |
errorFromXContent(XContentParser parser) |
RestStatus |
status()
The rest status code.
|
addHeader, copyHeaders, getHeaderspublic static final java.lang.String TEXT_CONTENT_TYPE
public BytesRestResponse(RestStatus status, XContentBuilder builder)
XContentBuilder.public BytesRestResponse(RestStatus status, java.lang.String content)
public BytesRestResponse(RestStatus status, java.lang.String contentType, java.lang.String content)
public BytesRestResponse(RestStatus status, java.lang.String contentType, byte[] content)
public BytesRestResponse(RestStatus status, java.lang.String contentType, BytesReference content)
public BytesRestResponse(RestChannel channel, java.lang.Exception e) throws java.io.IOException
java.io.IOExceptionpublic BytesRestResponse(RestChannel channel, RestStatus status, java.lang.Exception e) throws java.io.IOException
java.io.IOExceptionpublic java.lang.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 RestResponsepublic static ElasticsearchStatusException errorFromXContent(XContentParser parser) throws java.io.IOException
java.io.IOException