Package org.elasticsearch.rest
Class BytesRestResponse
java.lang.Object
org.elasticsearch.rest.RestResponse
org.elasticsearch.rest.BytesRestResponse
-
Field Summary
-
Constructor Summary
ConstructorDescriptionBytesRestResponse(RestChannel channel, Exception e)
BytesRestResponse(RestChannel channel, RestStatus status, Exception e)
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, String content)
Creates a new plain text response.BytesRestResponse(RestStatus status, String contentType, BytesReference content)
Creates a binary response.BytesRestResponse(RestStatus status, org.elasticsearch.common.xcontent.XContentBuilder builder)
Creates a new response based onXContentBuilder
. -
Method Summary
Modifier and TypeMethodDescriptioncontent()
The response content.The response content type.static ElasticsearchStatusException
errorFromXContent(org.elasticsearch.common.xcontent.XContentParser parser)
protected boolean
status()
The rest status code.Methods inherited from class org.elasticsearch.rest.RestResponse
addHeader, copyHeaders, filterHeaders, getHeaders
-
Field Details
-
TEXT_CONTENT_TYPE
- See Also:
- Constant Field Values
-
-
Constructor Details
-
BytesRestResponse
public BytesRestResponse(RestStatus status, org.elasticsearch.common.xcontent.XContentBuilder builder)Creates a new response based onXContentBuilder
. -
BytesRestResponse
Creates a new plain text response. -
BytesRestResponse
Creates a new plain text response. -
BytesRestResponse
Creates a binary response. -
BytesRestResponse
Creates a binary response. -
BytesRestResponse
- Throws:
IOException
-
BytesRestResponse
- Throws:
IOException
-
-
Method Details
-
contentType
Description copied from class:RestResponse
The response content type.- Specified by:
contentType
in classRestResponse
-
content
Description copied from class:RestResponse
The response content. Note, if the content isReleasable
it should automatically be released when done by the channel sending it.- Specified by:
content
in classRestResponse
-
status
Description copied from class:RestResponse
The rest status code.- Specified by:
status
in classRestResponse
-
skipStackTrace
protected boolean skipStackTrace() -
errorFromXContent
public static ElasticsearchStatusException errorFromXContent(org.elasticsearch.common.xcontent.XContentParser parser) throws IOException- Throws:
IOException
-