类 DefaultWebTestClient.DefaultRequestBodyUriSpec
java.lang.Object
cn.taketoday.test.web.reactive.server.DefaultWebTestClient.DefaultRequestBodyUriSpec
- 所有已实现的接口:
WebTestClient.RequestBodySpec,WebTestClient.RequestBodyUriSpec,WebTestClient.RequestHeadersSpec<WebTestClient.RequestBodySpec>,WebTestClient.RequestHeadersUriSpec<WebTestClient.RequestBodySpec>,WebTestClient.UriSpec<WebTestClient.RequestBodySpec>
- 封闭类:
- DefaultWebTestClient
private class DefaultWebTestClient.DefaultRequestBodyUriSpec
extends Object
implements WebTestClient.RequestBodyUriSpec
-
字段概要
字段修饰符和类型字段说明private final cn.taketoday.http.HttpHeadersprivate final cn.taketoday.http.HttpMethodprivate Consumer<cn.taketoday.http.client.reactive.ClientHttpRequest>private cn.taketoday.web.reactive.function.BodyInserter<?,? super cn.taketoday.http.client.reactive.ClientHttpRequest> private final Stringprivate URIprivate String -
构造器概要
构造器 -
方法概要
修饰符和类型方法说明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.Set the attribute with the given name to the given value.attributes(Consumer<Map<String, Object>> attributesConsumer) Manipulate the request attributes with the given consumer.body(cn.taketoday.web.reactive.function.BodyInserter<?, ? super cn.taketoday.http.client.reactive.ClientHttpRequest> inserter) Set the body of the request to the givenBodyInserter.Set the body from the given producer.Set the body from the given producer.<T,P extends org.reactivestreams.Publisher<T>>
WebTestClient.RequestHeadersSpec<?>body(P publisher, cn.taketoday.core.ParameterizedTypeReference<T> elementTypeRef) Variant ofWebTestClient.RequestBodySpec.body(Publisher, Class)that allows providing element type information with generics.<T,P extends org.reactivestreams.Publisher<T>>
WebTestClient.RequestHeadersSpec<?>Set the body from the givenPublisher.Set the body to the givenObjectvalue.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.Add a cookie with the given name and value.Manipulate this request's cookies with the given consumer.exchange()Perform the exchange without a request body.private cn.taketoday.http.HttpHeadersAdd the given, single header value under the given name.Manipulate the request's headers with the given consumer.ifModifiedSince(ZonedDateTime ifModifiedSince) Set the value of theIf-Modified-Sinceheader.ifNoneMatch(String... ifNoneMatches) Set the values of theIf-None-Matchheader.private cn.taketoday.web.reactive.function.client.ClientRequest.Builderprivate URIinitUri()Specify the URI for the request using a URI template and URI variables.Specify the URI for the request using a URI template and URI variables.Specify the URI using an absolute, fully constructedURI.Build the URI for the request with aUriBuilderobtained through theUriBuilderFactoryconfigured for this client.
-
字段详细资料
-
httpMethod
private final cn.taketoday.http.HttpMethod httpMethod -
uri
-
headers
private final cn.taketoday.http.HttpHeaders headers -
cookies
-
inserter
@Nullable private cn.taketoday.web.reactive.function.BodyInserter<?,? super cn.taketoday.http.client.reactive.ClientHttpRequest> inserter -
attributes
-
httpRequestConsumer
-
uriTemplate
-
requestId
-
-
构造器详细资料
-
DefaultRequestBodyUriSpec
DefaultRequestBodyUriSpec(cn.taketoday.http.HttpMethod httpMethod)
-
-
方法详细资料
-
uri
从接口复制的说明:WebTestClient.UriSpecSpecify the URI for the request using a URI template and URI variables.If a
UriBuilderFactorywas configured for the client (e.g. with a base URI) it will be used to expand the URI template.- 指定者:
uri在接口中WebTestClient.UriSpec<WebTestClient.RequestBodySpec>- 返回:
- spec to add headers or perform the exchange
-
uri
从接口复制的说明:WebTestClient.UriSpecSpecify the URI for the request using a URI template and URI variables.If a
UriBuilderFactorywas configured for the client (e.g. with a base URI) it will be used to expand the URI template.- 指定者:
uri在接口中WebTestClient.UriSpec<WebTestClient.RequestBodySpec>- 返回:
- spec to add headers or perform the exchange
-
uri
public WebTestClient.RequestBodySpec uri(Function<cn.taketoday.web.util.UriBuilder, URI> uriFunction) 从接口复制的说明:WebTestClient.UriSpecBuild the URI for the request with aUriBuilderobtained through theUriBuilderFactoryconfigured for this client.- 指定者:
uri在接口中WebTestClient.UriSpec<WebTestClient.RequestBodySpec>- 返回:
- spec to add headers or perform the exchange
-
uri
从接口复制的说明:WebTestClient.UriSpecSpecify the URI using an absolute, fully constructedURI.If a
UriBuilderFactorywas configured for the client with a base URI, that base URI will not be applied to the suppliedjava.net.URI. If you wish to have a base URI applied to ajava.net.URIyou must invoke eitherWebTestClient.UriSpec.uri(String, Object...)orWebTestClient.UriSpec.uri(String, Map)— for example,uri(myUri.toString()).- 指定者:
uri在接口中WebTestClient.UriSpec<WebTestClient.RequestBodySpec>- 返回:
- spec to add headers or perform the exchange
-
getHeaders
private cn.taketoday.http.HttpHeaders getHeaders() -
getCookies
-
header
从接口复制的说明:WebTestClient.RequestHeadersSpecAdd the given, single header value under the given name.- 指定者:
header在接口中WebTestClient.RequestHeadersSpec<WebTestClient.RequestBodySpec>- 参数:
headerName- the header nameheaderValues- the header value(s)- 返回:
- the same instance
-
headers
public WebTestClient.RequestBodySpec headers(Consumer<cn.taketoday.http.HttpHeaders> headersConsumer) 从接口复制的说明:WebTestClient.RequestHeadersSpecManipulate the request's headers with the given consumer. The headers provided to the consumer are "live", so that the consumer can be used to overwrite existing header values, remove values, or use any of the otherHttpHeadersmethods.- 指定者:
headers在接口中WebTestClient.RequestHeadersSpec<WebTestClient.RequestBodySpec>- 参数:
headersConsumer- a function that consumes theHttpHeaders- 返回:
- this builder
-
attribute
从接口复制的说明:WebTestClient.RequestHeadersSpecSet the attribute with the given name to the given value.- 指定者:
attribute在接口中WebTestClient.RequestHeadersSpec<WebTestClient.RequestBodySpec>- 参数:
name- the name of the attribute to addvalue- the value of the attribute to add- 返回:
- this builder
-
attributes
从接口复制的说明:WebTestClient.RequestHeadersSpecManipulate the request attributes with the given consumer. The attributes provided to the consumer are "live", so that the consumer can be used to inspect attributes, remove attributes, or use any of the other map-provided methods.- 指定者:
attributes在接口中WebTestClient.RequestHeadersSpec<WebTestClient.RequestBodySpec>- 参数:
attributesConsumer- a function that consumes the attributes- 返回:
- this builder
-
accept
从接口复制的说明:WebTestClient.RequestHeadersSpecSet the list of acceptable media types, as specified by theAcceptheader.- 指定者:
accept在接口中WebTestClient.RequestHeadersSpec<WebTestClient.RequestBodySpec>- 参数:
acceptableMediaTypes- the acceptable media types- 返回:
- the same instance
-
acceptCharset
从接口复制的说明:WebTestClient.RequestHeadersSpecSet the list of acceptable charsets, as specified by theAccept-Charsetheader.- 指定者:
acceptCharset在接口中WebTestClient.RequestHeadersSpec<WebTestClient.RequestBodySpec>- 参数:
acceptableCharsets- the acceptable charsets- 返回:
- the same instance
-
contentType
从接口复制的说明:WebTestClient.RequestBodySpecSet the media type of the body, as specified by theContent-Typeheader.- 指定者:
contentType在接口中WebTestClient.RequestBodySpec- 参数:
contentType- the content type- 返回:
- the same instance
- 另请参阅:
-
HttpHeaders.setContentType(MediaType)
-
contentLength
从接口复制的说明:WebTestClient.RequestBodySpecSet the length of the body in bytes, as specified by theContent-Lengthheader.- 指定者:
contentLength在接口中WebTestClient.RequestBodySpec- 参数:
contentLength- the content length- 返回:
- the same instance
- 另请参阅:
-
HttpHeaders.setContentLength(long)
-
cookie
从接口复制的说明:WebTestClient.RequestHeadersSpecAdd a cookie with the given name and value.- 指定者:
cookie在接口中WebTestClient.RequestHeadersSpec<WebTestClient.RequestBodySpec>- 参数:
name- the cookie namevalue- the cookie value- 返回:
- the same instance
-
cookies
public WebTestClient.RequestBodySpec cookies(Consumer<cn.taketoday.util.MultiValueMap<String, String>> cookiesConsumer) 从接口复制的说明:WebTestClient.RequestHeadersSpecManipulate this request's cookies with the given consumer. The map provided to the consumer is "live", so that the consumer can be used to overwrite existing header values, remove values, or use any of the otherMultiValueMapmethods.- 指定者:
cookies在接口中WebTestClient.RequestHeadersSpec<WebTestClient.RequestBodySpec>- 参数:
cookiesConsumer- a function that consumes the cookies map- 返回:
- this builder
-
ifModifiedSince
从接口复制的说明:WebTestClient.RequestHeadersSpecSet the value of theIf-Modified-Sinceheader.The date should be specified as the number of milliseconds since January 1, 1970 GMT.
- 指定者:
ifModifiedSince在接口中WebTestClient.RequestHeadersSpec<WebTestClient.RequestBodySpec>- 参数:
ifModifiedSince- the new value of the header- 返回:
- the same instance
-
ifNoneMatch
从接口复制的说明:WebTestClient.RequestHeadersSpecSet the values of theIf-None-Matchheader.- 指定者:
ifNoneMatch在接口中WebTestClient.RequestHeadersSpec<WebTestClient.RequestBodySpec>- 参数:
ifNoneMatches- the new value of the header- 返回:
- the same instance
-
bodyValue
从接口复制的说明:WebTestClient.RequestBodySpecSet the body to the givenObjectvalue. This method invokes thebodyValuemethod on the underlyingWebClient.- 指定者:
bodyValue在接口中WebTestClient.RequestBodySpec- 参数:
body- the value to write to the request body- 返回:
- spec for further declaration of the request
-
body
public <T,P extends org.reactivestreams.Publisher<T>> WebTestClient.RequestHeadersSpec<?> body(P publisher, cn.taketoday.core.ParameterizedTypeReference<T> elementTypeRef) 从接口复制的说明:WebTestClient.RequestBodySpecVariant ofWebTestClient.RequestBodySpec.body(Publisher, Class)that allows providing element type information with generics.- 指定者:
body在接口中WebTestClient.RequestBodySpec- 类型参数:
T- the type of the elements contained in the publisherP- the type of thePublisher- 参数:
publisher- the request body dataelementTypeRef- the type reference of elements contained in the publisher- 返回:
- spec for further declaration of the request
-
body
public <T,P extends org.reactivestreams.Publisher<T>> WebTestClient.RequestHeadersSpec<?> body(P publisher, Class<T> elementClass) 从接口复制的说明:WebTestClient.RequestBodySpecSet the body from the givenPublisher. Shortcut forWebTestClient.RequestBodySpec.body(BodyInserter)with a Publisher inserter.- 指定者:
body在接口中WebTestClient.RequestBodySpec- 类型参数:
T- the type of the elements contained in the publisherP- the type of thePublisher- 参数:
publisher- the request body dataelementClass- the class of elements contained in the publisher- 返回:
- spec for further declaration of the request
-
body
从接口复制的说明:WebTestClient.RequestBodySpecSet the body from the given producer. This method invokes thebody(Object, Class)method on the underlyingWebClient.- 指定者:
body在接口中WebTestClient.RequestBodySpec- 参数:
producer- the producer to write to the request. This must be aPublisheror another producer adaptable to aPublisherviaReactiveAdapterRegistryelementClass- the class of elements contained in the producer- 返回:
- spec for further declaration of the request
-
body
public WebTestClient.RequestHeadersSpec<?> body(Object producer, cn.taketoday.core.ParameterizedTypeReference<?> elementTypeRef) 从接口复制的说明:WebTestClient.RequestBodySpecSet the body from the given producer. This method invokes thebody(Object, TypeReference)method on the underlyingWebClient.- 指定者:
body在接口中WebTestClient.RequestBodySpec- 参数:
producer- the producer to write to the request. This must be aPublisheror another producer adaptable to aPublisherviaReactiveAdapterRegistryelementTypeRef- the type reference of elements contained in the producer- 返回:
- spec for further declaration of the request
-
body
public WebTestClient.RequestHeadersSpec<?> body(cn.taketoday.web.reactive.function.BodyInserter<?, ? super cn.taketoday.http.client.reactive.ClientHttpRequest> inserter) 从接口复制的说明:WebTestClient.RequestBodySpecSet the body of the request to the givenBodyInserter. This method invokes thebody(BodyInserter)method on the underlyingWebClient.- 指定者:
body在接口中WebTestClient.RequestBodySpec- 参数:
inserter- the body inserter to use- 返回:
- spec for further declaration of the request
- 另请参阅:
-
BodyInserters
-
exchange
从接口复制的说明:WebTestClient.RequestHeadersSpecPerform the exchange without a request body.- 指定者:
exchange在接口中WebTestClient.RequestHeadersSpec<WebTestClient.RequestBodySpec>- 返回:
- spec for decoding the response
-
initRequestBuilder
private cn.taketoday.web.reactive.function.client.ClientRequest.Builder initRequestBuilder() -
initUri
-