java.lang.Object
org.elasticsearch.rest.RestResponse
-
Field Summary
-
Constructor Summary
ConstructorDescriptionRestResponse
(RestChannel channel, Exception e) RestResponse
(RestChannel channel, RestStatus status, Exception e) RestResponse
(RestStatus status, String content) Creates a new plain text response.RestResponse
(RestStatus status, String responseMediaType, String content) Creates a new plain text response.RestResponse
(RestStatus status, String responseMediaType, BytesReference content) Creates a binary response.RestResponse
(RestStatus status, XContentBuilder builder) Creates a new response based onXContentBuilder
. -
Method Summary
Modifier and TypeMethodDescriptionvoid
Add a custom header.content()
void
static ElasticsearchStatusException
errorFromXContent
(XContentParser parser) filterHeaders
(Map<String, List<String>> headers) Returns custom headers that have been added.protected boolean
status()
-
Field Details
-
TEXT_CONTENT_TYPE
- See Also:
-
-
Constructor Details
-
RestResponse
Creates a new response based onXContentBuilder
. -
RestResponse
Creates a new plain text response. -
RestResponse
Creates a new plain text response. -
RestResponse
Creates a binary response. -
RestResponse
- Throws:
IOException
-
RestResponse
- Throws:
IOException
-
-
Method Details
-
contentType
-
content
-
status
-
skipStackTrace
protected boolean skipStackTrace() -
errorFromXContent
public static ElasticsearchStatusException errorFromXContent(XContentParser parser) throws IOException - Throws:
IOException
-
copyHeaders
-
addHeader
Add a custom header. -
getHeaders
Returns custom headers that have been added. This method should not be used to mutate headers. -
filterHeaders
-