public abstract class ResponseCreators extends Object
ResponseCreator
classes. Typically used to provide input for ResponseActions.andRespond(ResponseCreator)
.Modifier and Type | Method and Description |
---|---|
static ResponseCreator |
withResponse(org.springframework.core.io.Resource responseBody,
org.springframework.http.HttpHeaders headers)
Response with a given response body and headers.
|
static ResponseCreator |
withResponse(org.springframework.core.io.Resource responseBodyResource,
org.springframework.http.HttpHeaders headers,
org.springframework.http.HttpStatus statusCode,
String statusText)
Respond with a given response body (from a
Resource ) and headers. |
static ResponseCreator |
withResponse(String responseBody,
org.springframework.http.HttpHeaders headers)
Response with a given response body and headers.
|
static ResponseCreator |
withResponse(String responseBody,
org.springframework.http.HttpHeaders headers,
org.springframework.http.HttpStatus statusCode,
String statusText)
Respond with a given response body, headers, status code, and status text.
|
public static ResponseCreator withResponse(String responseBody, org.springframework.http.HttpHeaders headers, org.springframework.http.HttpStatus statusCode, String statusText)
responseBody
- the body of the responseheaders
- the response headersstatusCode
- the response status codestatusText
- the response status textResponseCreator
public static ResponseCreator withResponse(String responseBody, org.springframework.http.HttpHeaders headers)
responseBody
- the body of the responseheaders
- the response headersResponseCreator
public static ResponseCreator withResponse(org.springframework.core.io.Resource responseBodyResource, org.springframework.http.HttpHeaders headers, org.springframework.http.HttpStatus statusCode, String statusText)
Resource
) and headers. The response status code is HTTP 200 (OK).responseBodyResource
- a Resource
containing the body of the responseheaders
- the response headersstatusCode
- the response status codestatusText
- the response status textResponseCreator
public static ResponseCreator withResponse(org.springframework.core.io.Resource responseBody, org.springframework.http.HttpHeaders headers)
responseBody
- the body of the responseheaders
- the response headersResponseCreator
Copyright © 2016. All rights reserved.