B
- the builder sub-classpublic static interface MockServerHttpRequest.BaseBuilder<B extends MockServerHttpRequest.BaseBuilder<B>>
Modifier and Type | Method and Description |
---|---|
B |
accept(MediaType... acceptableMediaTypes)
Set the list of acceptable media types, as
specified by the
Accept header. |
B |
acceptCharset(Charset... acceptableCharsets)
Set the list of acceptable charsets, as specified
by the
Accept-Charset header. |
MockServerHttpRequest |
build()
Builds the request with no body.
|
B |
contextPath(String contextPath)
Set the contextPath to return.
|
B |
cookie(HttpCookie... cookie)
Add one or more cookies.
|
B |
cookies(MultiValueMap<String,HttpCookie> cookies)
Add the given cookies.
|
B |
header(String headerName,
String... headerValues)
Add the given, single header value under the given name.
|
B |
headers(MultiValueMap<String,String> headers)
Add the given header values.
|
B |
ifModifiedSince(long ifModifiedSince)
Set the value of the
If-Modified-Since header. |
B |
ifNoneMatch(String... ifNoneMatches)
Set the values of the
If-None-Match header. |
B |
ifUnmodifiedSince(long ifUnmodifiedSince)
Set the (new) value of the
If-Unmodified-Since header. |
B |
range(HttpRange... ranges)
Set the (new) value of the Range header.
|
B |
remoteAddress(InetSocketAddress remoteAddress)
Set the remote address to return.
|
MockServerWebExchange |
toExchange()
Shortcut for:
build().toExchange() |
B remoteAddress(InetSocketAddress remoteAddress)
B cookie(HttpCookie... cookie)
B cookies(MultiValueMap<String,HttpCookie> cookies)
cookies
- the cookies.B header(String headerName, String... headerValues)
headerName
- the header nameheaderValues
- the header value(s)HttpHeaders.add(String, String)
B headers(MultiValueMap<String,String> headers)
headers
- the header valuesB accept(MediaType... acceptableMediaTypes)
Accept
header.acceptableMediaTypes
- the acceptable media typesB acceptCharset(Charset... acceptableCharsets)
Accept-Charset
header.acceptableCharsets
- the acceptable charsetsB ifModifiedSince(long ifModifiedSince)
If-Modified-Since
header.
The date should be specified as the number of milliseconds since January 1, 1970 GMT.
ifModifiedSince
- the new value of the headerB ifUnmodifiedSince(long ifUnmodifiedSince)
If-Unmodified-Since
header.
The date should be specified as the number of milliseconds since January 1, 1970 GMT.
ifUnmodifiedSince
- the new value of the headerHttpHeaders.setIfUnmodifiedSince(long)
B ifNoneMatch(String... ifNoneMatches)
If-None-Match
header.ifNoneMatches
- the new value of the headerB range(HttpRange... ranges)
ranges
- the HTTP rangesHttpHeaders.setRange(List)
MockServerHttpRequest build()
MockServerHttpRequest.BodyBuilder.body(Publisher)
,
MockServerHttpRequest.BodyBuilder.body(String)
MockServerWebExchange toExchange()
build().toExchange()