public class RawResponse extends Object
Modifier and Type | Method and Description |
---|---|
String |
getContent()
Returns the raw response content.
|
String |
getContentEncoding()
Returns the value of the "Content-Encoding" header field.
|
int |
getContentLength()
Returns the value of the "Content-Length" header field.
|
String |
getContentType()
Returns the value of the "Content-Type" header field.
|
String |
getHeaderField(String name)
Returns the value of the named header field.
|
Map<String,List<String>> |
getHeaderFields()
Returns an unmodifiable Map of the header fields.
|
int |
getStatusCode()
Gets the status code from the HTTP response message, e.g.
|
String |
getStatusMessage()
Gets the HTTP response status message, if any, returned along with
the status code from a server.
|
protected static RawResponse |
parse(HttpURLConnection connection)
Parses the raw HTTP response from the specified URL connection.
|
protected static RawResponse parse(HttpURLConnection connection) throws IOException
connection
- The URL connection, must be in state completed and
not null
.IOException
- If the response content couldn't be read.public int getStatusCode()
public String getStatusMessage()
null
.public String getContent()
public Map<String,List<String>> getHeaderFields()
public String getHeaderField(String name)
name
- The name of the header.null
if there
is no such field in the header.public int getContentLength()
public String getContentType()
null
if not
known.public String getContentEncoding()
null
if not
known.Copyright © 2016 The Transaction Company. All Rights Reserved.