public static interface HttpClient.ConnectionResponse
Modifier and Type | Method and Description |
---|---|
long |
getContentLengthLong()
Returns the value of the
content-length header field as a long. |
java.lang.String |
getHeaderField(java.lang.String name)
Returns the value of the named header field.
|
java.util.Map<java.lang.String,java.util.List<java.lang.String>> |
getHeaderFields()
Returns an unmodifiable Map of the header fields.
|
int |
getResponseCode()
Gets the status code from an HTTP response message.
|
java.lang.String |
getResponseVersion()
Gets the HTTP version from the HTTP response.
|
java.lang.String getResponseVersion()
int getResponseCode() throws java.io.IOException
HTTP/1.0 200 OK HTTP/1.0 401 UnauthorizedIt will return 200 and 401 respectively. Returns -1 if no code can be discerned from the response (i.e., the response is not valid HTTP).
java.io.IOException
- if an error occurred connecting to the server.long getContentLengthLong()
content-length
header field as a long.-1
if the content length is not known.java.util.Map<java.lang.String,java.util.List<java.lang.String>> getHeaderFields()
java.lang.String getHeaderField(java.lang.String name)
name
- the name of a header field.null
if there is no such field in the header.