Package com.atlassian.sal.api.net
Interface Response
public interface Response
Represents the response when calling
Request.execute(ResponseHandler)- Since:
- 2.0
-
Method Summary
Modifier and TypeMethodDescription<T> TUnmarshall the response body as the specified typeGet's the header by the given nameGet a map of all the headersintboolean
-
Method Details
-
getStatusCode
int getStatusCode()- Returns:
- status code of the request.
-
getResponseBodyAsString
- Returns:
- the response body of the request.
- Throws:
ResponseException- If the response cannot be retrieved
-
getResponseBodyAsStream
- Returns:
- the response body of the request.
- Throws:
ResponseException- If the response cannot be retrieved
-
getEntity
Unmarshall the response body as the specified type- Parameters:
entityClass- the type of the response- Returns:
- the unmarshalled object
- Throws:
ResponseException- if there was difficulty reading the response or unmarshalling the object
-
getStatusText
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
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
separated, if multiple header fields with the given name were specified,
as per RFC2616. When the specified header key is not present,
nullis returned.
-
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.
-