public interface Response extends ResponseBody<Response>, ResponseOptions<Response>, Validatable<ValidatableResponse,Response>
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);
peek, prettyPeek, prettyPrint, print
as, as, as, as, as, as, as, htmlPath, jsonPath, jsonPath, path, xmlPath, xmlPath, xmlPath
asByteArray, asInputStream, asString
andReturn, body, contentType, cookie, cookies, detailedCookie, detailedCookies, getBody, getContentType, getCookie, getCookies, getDetailedCookie, getDetailedCookies, getHeader, getHeaders, getSessionId, getStatusCode, getStatusLine, getTime, getTimeIn, header, headers, sessionId, statusCode, statusLine, thenReturn, time, timeIn
then
Copyright © 2010–2019. All rights reserved.