|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface HttpResponse
A response object resulting from a HTTP request (HttpRequest) invoked from the UrlReaderProvider.
Both text and binary content are supported.
HttpResponseReader,
HttpRequest,
RequestMethod,
UrlReaderProvider| Method Summary | |
|---|---|
void |
close()
Closes any resources associated with reading the request response content. |
String |
getCharset()
The character set from the Content-Type header, or if explicitly provided in the HTTP request,
the result of HttpRequest.getCharsetName(). |
String |
getContent()
Returns a String with the content of the response body of this HTTP response. |
long |
getContentLength()
Returns the length of the content in the body of this HTTP response, as specified in the {code Content-Length} header. |
Reader |
getContentReader()
Returns a Reader instance to be used to read the content of the response body of this HTTP response. |
String |
getContentType()
Returns the value of the Content-Type header which indicates the format of the content sent in
response to the HTTP request. |
Map<String,String> |
getCookies()
Returns a map with the cookie collection listed in the Set-Cookie header of this response message. |
Map<String,String> |
getHeaders()
Returns the headers and their corresponding values in this HTTP response. |
Map<String,List<String>> |
getMultiHeaders()
Returns the headers and their corresponding values in this HTTP response. |
String |
getRedirectionUrl()
Gets the redirection URL if the request has been redirected and HttpRequest.getFollowRedirects() evaluates
to true |
int |
getRetriesPerformed()
Returns the number of retries performed by the UrlReaderProvider until a response was obtained. |
int |
getStatusCode()
Returns the integer HTTP response status code. |
String |
getStatusMessage()
Returns the HTTP response status message |
URL |
getUrl()
The URL object used to produce this HttpResponse |
void |
readContent(HttpResponseReader responseReader)
Reads this HTTP response using a custom class (i.e. |
| Method Detail |
|---|
String getRedirectionUrl()
HttpRequest.getFollowRedirects() evaluates
to true
HttpRequest has been redirected (and configured to follow redirects)
otherwise returns nullint getStatusCode()
String getStatusMessage()
String getCharset()
Content-Type header, or if explicitly provided in the HTTP request,
the result of HttpRequest.getCharsetName().
String getContentType()
Content-Type header which indicates the format of the content sent in
response to the HTTP request.
URL getUrl()
URL object used to produce this HttpResponse
Map<String,String> getHeaders()
getMultiHeaders() to obtain the multiple values in a list.
Map<String,List<String>> getMultiHeaders()
getHeaders()
to obtain them as a comma separated sequence
Map<String,String> getCookies()
Set-Cookie header of this response message.
void close()
close in interface CloseableReader getContentReader()
Reader instance to be used to read the content of the response body of this HTTP response.
Reader for the response body.String getContent()
String with the content of the response body of this HTTP response.
Stringvoid readContent(HttpResponseReader responseReader)
HttpResponseReader). The response body
InputStream is available for reading the response body of this message. Useful to process binary content.
responseReader - the custom response reader to process this HttpResponse object.int getRetriesPerformed()
UrlReaderProvider until a response was obtained.
This number should never be greater than the number of configured retries defined by
UrlReaderProvider.getRetries()
long getContentLength()
-1.
-1.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||