public interface IAPIResponse
Modifier and Type | Method and Description |
---|---|
int |
getContentLength()
Retrieve the content length
|
javax.json.JsonObject |
getJsonObject()
Retrieve the response as a parsed JsonObject
|
org.apache.http.ProtocolVersion |
getProtocolVersion()
Retrieve the protocol version
|
String |
getResponseCharsetName()
Retrieve the response content character set name
|
String |
getResponseContent()
Retrieve the response content
|
org.apache.http.StatusLine |
getStatusLine()
Retrieve the status line
|
List<org.apache.http.Header> |
headers()
Access the response headers list
|
boolean |
isFailure()
Find out if the last request was a failure
Code is 400-599
|
boolean |
isJson()
A crude way to see if a response might have json in it.
|
boolean |
isRequestFail()
Find out if the last request was a failure due to client input.
|
boolean |
isServerFailure()
Find out if the last request returned a 500 range error.
|
boolean |
isSuccess()
Find out if the last request was successful
|
void |
setContent(String content,
String charset)
Set the HTTP response content and character set.
|
int getContentLength()
javax.json.JsonObject getJsonObject() throws javax.json.JsonException, javax.json.stream.JsonParsingException
javax.json.JsonException
- if a JSON object cannot
be created due to i/o error (IOException would be
cause of JsonException)javax.json.stream.JsonParsingException
- if a JSON object cannot
be created due to incorrect representationorg.apache.http.ProtocolVersion getProtocolVersion()
String getResponseCharsetName()
String getResponseContent()
org.apache.http.StatusLine getStatusLine()
List<org.apache.http.Header> headers()
boolean isFailure()
boolean isJson()
boolean isRequestFail()
boolean isServerFailure()
boolean isSuccess()
Copyright © 2017. All rights reserved.