Package org.opensearch.rest
Class BytesRestResponse
java.lang.Object
org.opensearch.rest.RestResponse
org.opensearch.rest.BytesRestResponse
REST response in bytes
- Opensearch.api:
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionBytesRestResponse
(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.opensearch.common.xcontent.XContentBuilder builder) Creates a new response based onXContentBuilder
. -
Method Summary
Modifier and TypeMethodDescriptioncontent()
The response content.The response content type.static OpenSearchStatusException
errorFromXContent
(org.opensearch.common.xcontent.XContentParser parser) protected boolean
status()
The rest status code.Methods inherited from class org.opensearch.rest.RestResponse
addHeader, copyHeaders, getHeaders
-
Field Details
-
TEXT_CONTENT_TYPE
- See Also:
-
-
Constructor Details
-
BytesRestResponse
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 OpenSearchStatusException errorFromXContent(org.opensearch.common.xcontent.XContentParser parser) throws IOException - Throws:
IOException
-