com.atlassian.sal.api.net
Interface Response


public interface Response

Represents the response when calling Request.execute(ResponseHandler)

Since:
2.0

Method Summary
 java.lang.String getHeader(java.lang.String name)
          Get's the header by the given name
 java.util.Map<java.lang.String,java.lang.String> getHeaders()
          Get a map of all the headers
 java.io.InputStream getResponseBodyAsStream()
           
 java.lang.String getResponseBodyAsString()
           
 int getStatusCode()
           
 java.lang.String getStatusText()
           
 boolean isSuccessful()
           
 

Method Detail

getStatusCode

int getStatusCode()
Returns:
status code of the request.

getResponseBodyAsString

java.lang.String getResponseBodyAsString()
                                         throws ResponseException
Returns:
the response body of the request.
Throws:
ResponseException - If the response cannot be retrieved

getResponseBodyAsStream

java.io.InputStream getResponseBodyAsStream()
                                            throws ResponseException
Returns:
the response body of the request.
Throws:
ResponseException - If the response cannot be retrieved

getStatusText

java.lang.String getStatusText()
Returns:
status test of the response

isSuccessful

boolean isSuccessful()
Returns:
true if network returned a status code in the 200 range or 300 range

getHeader

java.lang.String getHeader(java.lang.String name)
Get's the header by the given name

Parameters:
name - The name of the header
Returns:
The value of the header. This will include all values, comma seperated, if multiple header fields with the given name were specified, as per RFC2616.

getHeaders

java.util.Map<java.lang.String,java.lang.String> getHeaders()
Get a map of all the headers

Returns:
A map of header names to header values. The header values will include all values, comma seperated, if multiple header fields with the given name were specified, as per RFC2616.


Copyright © 2009 Atlassian. All Rights Reserved.