B
- the builder subclasspublic 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. |
B |
acceptLanguageAsLocales(Locale... acceptableLocales)
Set the list of acceptable locales, as specified
by the
Accept-Languages 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 |
localAddress(InetSocketAddress localAddress)
Set the local address to return.
|
B |
queryParam(String name,
Object... values)
Append the given query parameter to the existing query parameters.
|
B |
queryParams(MultiValueMap<String,String> params)
Add the given query parameters and values.
|
B |
range(HttpRange... ranges)
Set the (new) value of the Range header.
|
B |
remoteAddress(InetSocketAddress remoteAddress)
Set the remote address to return.
|
void |
sslInfo(SslInfo sslInfo)
Set SSL session information and certificates.
|
B queryParam(String name, Object... values)
?foo
instead of ?foo=bar
).
The provided query name and values will be encoded.
name
- the query parameter namevalues
- the query parameter valuesB queryParams(MultiValueMap<String,String> params)
params
- the paramsB remoteAddress(InetSocketAddress remoteAddress)
B localAddress(InetSocketAddress localAddress)
void sslInfo(SslInfo sslInfo)
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 acceptLanguageAsLocales(Locale... acceptableLocales)
Accept-Languages
header.acceptableLocales
- the acceptable localesB 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)