java.lang.Object
org.elasticsearch.rest.RestResponse
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionRestResponse(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) RestResponse(RestStatus status, ChunkedRestResponseBody content) RestResponse(RestStatus status, XContentBuilder builder) Creates a new response based onXContentBuilder. -
Method Summary
Modifier and TypeMethodDescriptionvoidAdd a custom header.content()voidstatic ElasticsearchStatusExceptionerrorFromXContent(XContentParser parser) filterHeaders(Map<String, List<String>> headers) Returns custom headers that have been added.booleanprotected booleanstatus()
-
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
-
RestResponse
-
RestResponse
- Throws:
IOException
-
RestResponse
- Throws:
IOException
-
-
Method Details
-
contentType
-
content
-
chunkedContent
-
isChunked
public boolean isChunked() -
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
-