Interface Response
-
- All Superinterfaces:
java.lang.AutoCloseable
public interface Response extends java.lang.AutoCloseableGeneric HTTP response from OpenSearch
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidclose()Releases all resources associated with this body stream.java.util.Optional<Body>getBody()The optional body of the response.java.util.Collection<java.util.Map.Entry<java.lang.String,java.lang.String>>getHeaders()List of headersjava.lang.StringgetMethod()The HTTP methodjava.lang.StringgetProtocol()The HTTP protocol versionjava.lang.StringgetReason()The status messageintgetStatus()The status codejava.lang.StringgetUri()Full URI of the request
-
-
-
Method Detail
-
getBody
java.util.Optional<Body> getBody()
The optional body of the response. IfOptional.empty()then no body was sent with the response.- Returns:
- optional body of the response
-
getProtocol
java.lang.String getProtocol()
The HTTP protocol version- Returns:
- HTTP protocol version
-
getMethod
java.lang.String getMethod()
The HTTP method- Returns:
- HTTP method
-
getReason
java.lang.String getReason()
The status message- Returns:
- status message
-
getStatus
int getStatus()
The status code- Returns:
- status code
-
getUri
java.lang.String getUri()
Full URI of the request- Returns:
- full URI of the request
-
getHeaders
java.util.Collection<java.util.Map.Entry<java.lang.String,java.lang.String>> getHeaders()
List of headers- Returns:
- list of headers
-
close
void close() throws java.io.IOExceptionReleases all resources associated with this body stream.- Specified by:
closein interfacejava.lang.AutoCloseable- Throws:
java.io.IOException
-
-