类 MockServerHttpRequest.DefaultBodyBuilder
java.lang.Object
cn.taketoday.mock.http.server.reactive.MockServerHttpRequest.DefaultBodyBuilder
- 所有已实现的接口:
MockServerHttpRequest.BaseBuilder<MockServerHttpRequest.BodyBuilder>,MockServerHttpRequest.BodyBuilder
private static class MockServerHttpRequest.DefaultBodyBuilder
extends Object
implements MockServerHttpRequest.BodyBuilder
-
字段概要
字段修饰符和类型字段说明private Stringprivate final cn.taketoday.util.MultiValueMap<String,cn.taketoday.http.HttpCookie> private final cn.taketoday.http.HttpHeadersprivate InetSocketAddressprivate final cn.taketoday.http.HttpMethodprivate final cn.taketoday.web.util.UriComponentsBuilderprivate InetSocketAddressprivate cn.taketoday.http.server.reactive.SslInfoprivate final URI -
构造器概要
构造器 -
方法概要
修饰符和类型方法说明accept(cn.taketoday.http.MediaType... acceptableMediaTypes) Set the list of acceptable media types, as specified by theAcceptheader.acceptCharset(Charset... acceptableCharsets) Set the list of acceptable charsets, as specified by theAccept-Charsetheader.acceptLanguageAsLocales(Locale... acceptableLocales) Set the list of acceptable locales, as specified by theAccept-Languagesheader.private voidSet the body of the request and build it.body(org.reactivestreams.Publisher<? extends cn.taketoday.core.io.buffer.DataBuffer> body) Set the body of the request and build it.build()Builds the request with no body.contentLength(long contentLength) Set the length of the body in bytes, as specified by theContent-Lengthheader.contentType(cn.taketoday.http.MediaType contentType) Set the media type of the body, as specified by theContent-Typeheader.contextPath(String contextPath) Set the contextPath to return.cookie(cn.taketoday.http.HttpCookie... cookies) Add one or more cookies.Add the given cookies.private Charsetprivate URIAdd the given, single header value under the given name.Add the given header values.ifModifiedSince(long ifModifiedSince) Set the value of theIf-Modified-Sinceheader.ifNoneMatch(String... ifNoneMatches) Set the values of theIf-None-Matchheader.ifUnmodifiedSince(long ifUnmodifiedSince) Set the (new) value of theIf-Unmodified-Sinceheader.localAddress(InetSocketAddress localAddress) Set the local address to return.queryParam(String name, Object... values) Append the given query parameter to the existing query parameters.queryParams(cn.taketoday.util.MultiValueMap<String, String> params) Add the given query parameters and values.range(cn.taketoday.http.HttpRange... ranges) Set the (new) value of the Range header.remoteAddress(InetSocketAddress remoteAddress) Set the remote address to return.voidsslInfo(cn.taketoday.http.server.reactive.SslInfo sslInfo) Set SSL session information and certificates.
-
字段详细资料
-
method
private final cn.taketoday.http.HttpMethod method -
url
-
contextPath
-
queryParamsBuilder
private final cn.taketoday.web.util.UriComponentsBuilder queryParamsBuilder -
headers
private final cn.taketoday.http.HttpHeaders headers -
cookies
-
remoteAddress
-
localAddress
-
sslInfo
@Nullable private cn.taketoday.http.server.reactive.SslInfo sslInfo
-
-
构造器详细资料
-
DefaultBodyBuilder
DefaultBodyBuilder(cn.taketoday.http.HttpMethod method, URI url)
-
-
方法详细资料
-
contextPath
从接口复制的说明:MockServerHttpRequest.BaseBuilderSet the contextPath to return. -
queryParam
从接口复制的说明:MockServerHttpRequest.BaseBuilderAppend the given query parameter to the existing query parameters. If no values are given, the resulting URI will contain the query parameter name only (i.e.?fooinstead of?foo=bar).The provided query name and values will be encoded.
- 指定者:
queryParam在接口中MockServerHttpRequest.BaseBuilder<MockServerHttpRequest.BodyBuilder>- 参数:
name- the query parameter namevalues- the query parameter values- 返回:
- this UriComponentsBuilder
-
queryParams
public MockServerHttpRequest.BodyBuilder queryParams(cn.taketoday.util.MultiValueMap<String, String> params) 从接口复制的说明:MockServerHttpRequest.BaseBuilderAdd the given query parameters and values. The provided query name and corresponding values will be encoded.- 指定者:
queryParams在接口中MockServerHttpRequest.BaseBuilder<MockServerHttpRequest.BodyBuilder>- 参数:
params- the params- 返回:
- this UriComponentsBuilder
-
remoteAddress
从接口复制的说明:MockServerHttpRequest.BaseBuilderSet the remote address to return. -
localAddress
从接口复制的说明:MockServerHttpRequest.BaseBuilderSet the local address to return. -
sslInfo
public void sslInfo(cn.taketoday.http.server.reactive.SslInfo sslInfo) 从接口复制的说明:MockServerHttpRequest.BaseBuilderSet SSL session information and certificates. -
cookie
从接口复制的说明:MockServerHttpRequest.BaseBuilderAdd one or more cookies. -
cookies
public MockServerHttpRequest.BodyBuilder cookies(cn.taketoday.util.MultiValueMap<String, cn.taketoday.http.HttpCookie> cookies) 从接口复制的说明:MockServerHttpRequest.BaseBuilderAdd the given cookies.- 指定者:
cookies在接口中MockServerHttpRequest.BaseBuilder<MockServerHttpRequest.BodyBuilder>- 参数:
cookies- the cookies.
-
header
从接口复制的说明:MockServerHttpRequest.BaseBuilderAdd the given, single header value under the given name.- 指定者:
header在接口中MockServerHttpRequest.BaseBuilder<MockServerHttpRequest.BodyBuilder>- 参数:
headerName- the header nameheaderValues- the header value(s)- 另请参阅:
-
HttpHeaders.add(String, String)
-
headers
public MockServerHttpRequest.BodyBuilder headers(cn.taketoday.util.MultiValueMap<String, String> headers) 从接口复制的说明:MockServerHttpRequest.BaseBuilderAdd the given header values.- 指定者:
headers在接口中MockServerHttpRequest.BaseBuilder<MockServerHttpRequest.BodyBuilder>- 参数:
headers- the header values
-
accept
public MockServerHttpRequest.BodyBuilder accept(cn.taketoday.http.MediaType... acceptableMediaTypes) 从接口复制的说明:MockServerHttpRequest.BaseBuilderSet the list of acceptable media types, as specified by theAcceptheader.- 指定者:
accept在接口中MockServerHttpRequest.BaseBuilder<MockServerHttpRequest.BodyBuilder>- 参数:
acceptableMediaTypes- the acceptable media types
-
acceptCharset
从接口复制的说明:MockServerHttpRequest.BaseBuilderSet the list of acceptable charsets, as specified by theAccept-Charsetheader.- 指定者:
acceptCharset在接口中MockServerHttpRequest.BaseBuilder<MockServerHttpRequest.BodyBuilder>- 参数:
acceptableCharsets- the acceptable charsets
-
acceptLanguageAsLocales
从接口复制的说明:MockServerHttpRequest.BaseBuilderSet the list of acceptable locales, as specified by theAccept-Languagesheader.- 指定者:
acceptLanguageAsLocales在接口中MockServerHttpRequest.BaseBuilder<MockServerHttpRequest.BodyBuilder>- 参数:
acceptableLocales- the acceptable locales
-
contentLength
从接口复制的说明:MockServerHttpRequest.BodyBuilderSet the length of the body in bytes, as specified by theContent-Lengthheader.- 指定者:
contentLength在接口中MockServerHttpRequest.BodyBuilder- 参数:
contentLength- the content length- 返回:
- this builder
- 另请参阅:
-
HttpHeaders.setContentLength(long)
-
contentType
从接口复制的说明:MockServerHttpRequest.BodyBuilderSet the media type of the body, as specified by theContent-Typeheader.- 指定者:
contentType在接口中MockServerHttpRequest.BodyBuilder- 参数:
contentType- the content type- 返回:
- this builder
- 另请参阅:
-
HttpHeaders.setContentType(MediaType)
-
ifModifiedSince
从接口复制的说明:MockServerHttpRequest.BaseBuilderSet the value of theIf-Modified-Sinceheader.The date should be specified as the number of milliseconds since January 1, 1970 GMT.
- 指定者:
ifModifiedSince在接口中MockServerHttpRequest.BaseBuilder<MockServerHttpRequest.BodyBuilder>- 参数:
ifModifiedSince- the new value of the header
-
ifUnmodifiedSince
从接口复制的说明:MockServerHttpRequest.BaseBuilderSet the (new) value of theIf-Unmodified-Sinceheader.The date should be specified as the number of milliseconds since January 1, 1970 GMT.
- 指定者:
ifUnmodifiedSince在接口中MockServerHttpRequest.BaseBuilder<MockServerHttpRequest.BodyBuilder>- 参数:
ifUnmodifiedSince- the new value of the header- 另请参阅:
-
HttpHeaders.setIfUnmodifiedSince(long)
-
ifNoneMatch
从接口复制的说明:MockServerHttpRequest.BaseBuilderSet the values of theIf-None-Matchheader.- 指定者:
ifNoneMatch在接口中MockServerHttpRequest.BaseBuilder<MockServerHttpRequest.BodyBuilder>- 参数:
ifNoneMatches- the new value of the header
-
range
从接口复制的说明:MockServerHttpRequest.BaseBuilderSet the (new) value of the Range header.- 指定者:
range在接口中MockServerHttpRequest.BaseBuilder<MockServerHttpRequest.BodyBuilder>- 参数:
ranges- the HTTP ranges- 另请参阅:
-
HttpHeaders.setRange(java.util.Collection<cn.taketoday.http.HttpRange>)
-
build
从接口复制的说明:MockServerHttpRequest.BaseBuilderBuilds the request with no body. -
body
从接口复制的说明:MockServerHttpRequest.BodyBuilderSet the body of the request and build it.The String is assumed to be UTF-8 encoded unless the request has a "content-type" header with a charset attribute.
- 指定者:
body在接口中MockServerHttpRequest.BodyBuilder- 参数:
body- the body as text- 返回:
- the built request entity
-
getCharset
-
body
public MockServerHttpRequest body(org.reactivestreams.Publisher<? extends cn.taketoday.core.io.buffer.DataBuffer> body) 从接口复制的说明:MockServerHttpRequest.BodyBuilderSet the body of the request and build it.- 指定者:
body在接口中MockServerHttpRequest.BodyBuilder- 参数:
body- the body- 返回:
- the built request entity
-
applyCookiesIfNecessary
private void applyCookiesIfNecessary() -
getUrlToUse
-