Interface HttpClientResponse
-
- All Known Implementing Classes:
SimpleHttpClientResponse
public interface HttpClientResponse
Models the response that a script can receive from sending aHttpClientRequest
over aHttpClient
. Is designed to be a basic HTTP/1.1 response. See http://www.w3.org/Protocols/rfc2616/rfc2616-sec6.html#sec6 NB: 'HttpClientResponse' used rather than 'Response' to avoid clashes with org.restlet.Response.- Since:
- 12.0.0
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description Map<String,String>
getCookies()
Retrieve any cookies sent with the accessed resource.String
getEntity()
Retrieve the entity sent with the accessed resource.Map<String,String>
getHeaders()
Retrieve the headers sent with the accessed resource.String
getReasonPhrase()
Retrieve the reason phrase of the accessed resource.Integer
getStatusCode()
Retrieve the status code of the accessed resource.boolean
hasCookies()
Indicates if the accessed resource had cookies.boolean
hasHeaders()
Indicates if the accessed resource has headers.
-
-
-
Method Detail
-
getStatusCode
Integer getStatusCode()
Retrieve the status code of the accessed resource.- Returns:
- A three digit integer that corresponds to an HTTP status code. Can be null if no status code was set.
-
getReasonPhrase
String getReasonPhrase()
Retrieve the reason phrase of the accessed resource.- Returns:
- The HTTP reason phrase. Can be null if no status code was set.
-
hasHeaders
boolean hasHeaders()
Indicates if the accessed resource has headers.- Returns:
- True if the accessed resource has headers.
-
getHeaders
Map<String,String> getHeaders()
Retrieve the headers sent with the accessed resource.- Returns:
- The headers sent with the accessed resource. Can be implemented as returning null or an empty map in the absence of any headers.
-
getEntity
String getEntity()
Retrieve the entity sent with the accessed resource.- Returns:
- The entity sent with the accessed resource. Can be null if no entity was set.
-
hasCookies
boolean hasCookies()
Indicates if the accessed resource had cookies.- Returns:
- True if the accessed resource had cookies.
-
-