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