public class BytesRestResponse extends RestResponse
Modifier and Type | Field and Description |
---|---|
static String |
TEXT_CONTENT_TYPE |
customHeaders
Constructor and Description |
---|
BytesRestResponse(RestChannel channel,
RestStatus status,
Throwable t) |
BytesRestResponse(RestChannel channel,
Throwable t) |
BytesRestResponse(RestStatus status) |
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,
BytesReference content)
Creates a binary response.
|
BytesRestResponse(RestStatus status,
String contentType,
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.
|
String |
contentType()
The response content type.
|
RestStatus |
status()
The rest status code.
|
addHeader, copyHeaders, getHeaders
public static final String TEXT_CONTENT_TYPE
public BytesRestResponse(RestStatus status)
public BytesRestResponse(RestStatus status, XContentBuilder builder)
XContentBuilder
.public BytesRestResponse(RestStatus status, String content)
public BytesRestResponse(RestStatus status, String contentType, String content)
public BytesRestResponse(RestStatus status, String contentType, byte[] content)
public BytesRestResponse(RestStatus status, String contentType, BytesReference content)
public BytesRestResponse(RestChannel channel, Throwable t) throws IOException
IOException
public BytesRestResponse(RestChannel channel, RestStatus status, Throwable t) throws IOException
IOException
public String contentType()
RestResponse
contentType
in class RestResponse
public BytesReference content()
RestResponse
Releasable
it
should automatically be released when done by the channel sending it.content
in class RestResponse
public RestStatus status()
RestResponse
status
in class RestResponse
Copyright © 2009–2016. All rights reserved.