|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface Response
The response of a request made by REST Assured.
Usage example:
Response response = get("/lotto"); String body = response.getBody().asString(); String headerValue = response.getHeader("headerName"); String cookieValue = response.getCookie("cookieName");
You can also map the response body to a Java object automatically. REST Assured will use Jackson, Gson and JAXB to accommodate this:
Message message = get("/message").as(Message.class);
Method Summary | |
---|---|
Response |
andReturn()
Syntactic sugar, simply returns the same response instance. |
ResponseBody |
body()
Returns the response body |
String |
contentType()
Get the content type of the response |
String |
cookie(String name)
Get a single cookie value associated with the given name. |
Map<String,String> |
cookies()
The response cookies as simple name/value pair. |
Cookie |
detailedCookie(String name)
Get a single cookie including all attributes associated with the given name. |
Cookies |
detailedCookies()
The response cookies with all the attributes. |
ResponseBody |
getBody()
Returns the response body |
String |
getContentType()
Get the content type of the response |
String |
getCookie(String name)
Get a single cookie value associated with the given name. |
Map<String,String> |
getCookies()
The response cookies as simple name/value pair. |
Cookie |
getDetailedCookie(String name)
Get a single cookie including all attributes associated with the given name. |
Cookies |
getDetailedCookies()
The response cookies with all the attributes. |
String |
getHeader(String name)
Get a single header value associated with the given name. |
Headers |
getHeaders()
The response headers. |
String |
getSessionId()
Get the session id from the response. |
int |
getStatusCode()
Get the status code of the response. |
String |
getStatusLine()
Get the status line of the response. |
String |
header(String name)
Get a single header value associated with the given name. |
Headers |
headers()
The response headers. |
String |
sessionId()
Get the session id from the response. |
int |
statusCode()
Get the status code of the response. |
String |
statusLine()
Get the status line of the response. |
Response |
thenReturn()
Syntactic sugar, simply returns the same response instance. |
Methods inherited from interface com.jayway.restassured.response.ResponseBody |
---|
as, as, asByteArray, asInputStream, asString, jsonPath, path, prettyPrint, print, xmlPath |
Method Detail |
---|
Response andReturn()
Response thenReturn()
ResponseBody body()
ResponseBody getBody()
Headers headers()
Headers getHeaders()
String header(String name)
Headers.getList(String)
in order to get all values.
null
if value was not found.String getHeader(String name)
Headers.getList(String)
in order to get all values..
null
if value was not found.Map<String,String> cookies()
detailedCookies()
.
Cookies detailedCookies()
Map<String,String> getCookies()
getDetailedCookies()
.
Cookies getDetailedCookies()
String cookie(String name)
detailedCookie(String)
.
null
if value was not found.String getCookie(String name)
getDetailedCookie(String)
.
null
if value was not found.Cookie detailedCookie(String name)
null
if value was not found.Cookie getDetailedCookie(String name)
null
if value was not found.String contentType()
null
if not found.String getContentType()
null
if not found.String statusLine()
String getStatusLine()
String sessionId()
SessionConfig
.
null
if not defined.String getSessionId()
SessionConfig
.
null
if not defined.int statusCode()
int getStatusCode()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |