public abstract class RestResponse extends Object implements HasRestHeaders
Modifier and Type | Field and Description |
---|---|
protected Map<String,List<String>> |
customHeaders |
Constructor and Description |
---|
RestResponse() |
Modifier and Type | Method and Description |
---|---|
void |
addHeader(String name,
String value)
Add a custom header.
|
void |
addHeaders(Map<String,List<String>> headers) |
abstract BytesReference |
content()
The response content.
|
abstract boolean |
contentThreadSafe()
Can the content byte[] be used only with this thread (false), or by any thread (true).
|
abstract String |
contentType()
The response content type.
|
Map<String,List<String>> |
getHeaders()
Returns custom headers that have been added, or null if none have been set.
|
abstract RestStatus |
status()
The rest status code.
|
public abstract String contentType()
public abstract boolean contentThreadSafe()
public abstract BytesReference content()
Releasable
it
should automatically be released when done by the channel sending it.public abstract RestStatus status()
@Nullable public Map<String,List<String>> getHeaders()
getHeaders
in interface HasRestHeaders
Copyright © 2009–2015. All rights reserved.