public class HttpResponseHttpURLConnectionAdapter extends java.lang.Object implements HttpResponse
| Constructor and Description |
|---|
HttpResponseHttpURLConnectionAdapter(java.net.HttpURLConnection httpURLConnection) |
| Modifier and Type | Method and Description |
|---|---|
java.lang.String |
getHeader(java.lang.String name)
Gets the value of an HTTP response header.
|
java.util.Map<java.lang.String,java.util.List<java.lang.String>> |
getHeaders()
Gets the HTTP response headers and their values.
|
java.lang.String |
getRequestMethod()
Gets the request method associated with this response.
|
java.net.URL |
getRequestUrl()
Gets the request
URL associated with this response. |
int |
getResponseCode()
Gets the HTTP response code.
|
java.lang.String |
getResponseMessage()
Gets the HTTP response message.
|
public HttpResponseHttpURLConnectionAdapter(java.net.HttpURLConnection httpURLConnection)
public java.net.URL getRequestUrl()
HttpResponseURL associated with this response.getRequestUrl in interface HttpResponsepublic java.lang.String getRequestMethod()
HttpResponsegetRequestMethod in interface HttpResponsepublic int getResponseCode()
HttpResponse
If reading the HTTP status line fails, Integer.MIN_VALUE is returned.
getResponseCode in interface HttpResponsepublic java.lang.String getResponseMessage()
HttpResponse
If reading the HTTP status line fails, null is returned.
getResponseMessage in interface HttpResponsenull.public java.util.Map<java.lang.String,java.util.List<java.lang.String>> getHeaders()
HttpResponsegetHeaders in interface HttpResponsepublic java.lang.String getHeader(java.lang.String name)
HttpResponse
If the header occurs multiple times, it depends on the underlying implementation
which value is returned.
In this case prefer HttpResponse.getHeaders() instead.
getHeader in interface HttpResponsename or null.