Package org.elasticsearch.client
Class Response
- java.lang.Object
-
- org.elasticsearch.client.Response
-
public class Response extends java.lang.ObjectHolds an elasticsearch response. It wraps theHttpResponsereturned and associates it with its correspondingRequestLineandHttpHost.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description org.apache.http.HttpEntitygetEntity()Returns the response body available, null otherwisejava.lang.StringgetHeader(java.lang.String name)Returns the value of the first header with a specified name of this message.org.apache.http.Header[]getHeaders()Returns all the response headersorg.apache.http.HttpHostgetHost()Returns the node that returned this responseorg.apache.http.RequestLinegetRequestLine()Returns the request line that generated this responseorg.apache.http.StatusLinegetStatusLine()Returns the status line of the current responsejava.lang.StringtoString()
-
-
-
Method Detail
-
getRequestLine
public org.apache.http.RequestLine getRequestLine()
Returns the request line that generated this response
-
getHost
public org.apache.http.HttpHost getHost()
Returns the node that returned this response
-
getStatusLine
public org.apache.http.StatusLine getStatusLine()
Returns the status line of the current response
-
getHeaders
public org.apache.http.Header[] getHeaders()
Returns all the response headers
-
getHeader
public java.lang.String getHeader(java.lang.String name)
Returns the value of the first header with a specified name of this message. If there is more than one matching header in the message the first element is returned. If there is no matching header in the messagenullis returned.
-
getEntity
public org.apache.http.HttpEntity getEntity()
Returns the response body available, null otherwise- See Also:
HttpEntity
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-