|
||||||||||
| 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");
The response can only be returned if you don't use any expectations on the body. E.g.
expect().body(equalTo("my body")).when().get("/something").asString()
will throw an IllegalStateException because of the body expectation matcher.
| 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. |
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. |
String |
getHeader(String name)
Get a single header value associated with the given name. |
Map<String,String> |
getHeaders()
The response headers. |
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. |
Map<String,String> |
headers()
The response headers. |
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 |
|---|
asByteArray, asString, print |
| Method Detail |
|---|
Response andReturn()
Response thenReturn()
ResponseBody body()
ResponseBody getBody()
Map<String,String> headers()
Map<String,String> getHeaders()
String header(String name)
null if value was not found.String getHeader(String name)
null if value was not found.Map<String,String> cookies()
Map<String,String> getCookies()
String cookie(String name)
null if value was not found.String getCookie(String name)
null if value was not found.String contentType()
null if not found.String getContentType()
null if not found.String statusLine()
String getStatusLine()
int statusCode()
int getStatusCode()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||