Class Response
java.lang.Object
org.springframework.extensions.webscripts.connector.Response
Representation of the response from a remote HTTP API call.
- Author:
- Kevin Roast
-
Constructor Summary
ConstructorsConstructorDescriptionResponse(InputStream is, ResponseStatus status) Instantiates a new response.Response(String data, ResponseStatus status) Instantiates a new response.Response(ResponseStatus status) Instantiates a new response. -
Method Summary
Modifier and TypeMethodDescriptionGets the encoding.Gets the response.Gets the response stream.Gets the status.getText()Gets the text of the response.voidsetEncoding(String encoding) Sets the encoding.toString()
-
Constructor Details
-
Response
Instantiates a new response.- Parameters:
status- the status
-
Response
Instantiates a new response.- Parameters:
data- the datastatus- the status
-
Response
Instantiates a new response.- Parameters:
is- the isstatus- the status
-
-
Method Details
-
setEncoding
Sets the encoding.- Parameters:
encoding- the new encoding
-
getResponse
Gets the response.- Returns:
- the data stream from the response object - will be null on error or if the response has already been streamed to an OutputStream.
-
getText
Gets the text of the response.- Returns:
- the text
-
getResponseStream
Gets the response stream.- Returns:
- the response InputStream if set during construction, else will be null.
-
getStatus
Gets the status.- Returns:
- Status object representing the response status and any error information
-
getEncoding
Gets the encoding.- Returns:
- the response encoding
-
toString
-