|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.thetransactioncompany.jsonrpc2.client.RawResponse
public class RawResponse
Represents the raw HTTP response to a JSON-RPC 2.0 request or notification. Can be used to retrieve the unparsed response content and headers.
Method Summary | |
---|---|
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. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
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.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |