接口 WebTestClient.RequestBodySpec

所有超级接口:
WebTestClient.RequestHeadersSpec<WebTestClient.RequestBodySpec>
所有已知子接口:
WebTestClient.RequestBodyUriSpec
所有已知实现类:
DefaultWebTestClient.DefaultRequestBodyUriSpec
封闭接口:
WebTestClient

public static interface WebTestClient.RequestBodySpec extends WebTestClient.RequestHeadersSpec<WebTestClient.RequestBodySpec>
Specification for providing body of a request.
  • 方法详细资料

    • contentLength

      WebTestClient.RequestBodySpec contentLength(long contentLength)
      Set the length of the body in bytes, as specified by the Content-Length header.
      参数:
      contentLength - the content length
      返回:
      the same instance
      另请参阅:
      • HttpHeaders.setContentLength(long)
    • contentType

      WebTestClient.RequestBodySpec contentType(cn.taketoday.http.MediaType contentType)
      Set the media type of the body, as specified by the Content-Type header.
      参数:
      contentType - the content type
      返回:
      the same instance
      另请参阅:
      • HttpHeaders.setContentType(MediaType)
    • bodyValue

      Set the body to the given Object value. This method invokes the bodyValue method on the underlying WebClient.
      参数:
      body - the value to write to the request body
      返回:
      spec for further declaration of the request
    • body

      <T, S extends org.reactivestreams.Publisher<T>> WebTestClient.RequestHeadersSpec<?> body(S publisher, Class<T> elementClass)
      Set the body from the given Publisher. Shortcut for body(BodyInserter) with a Publisher inserter.
      类型参数:
      T - the type of the elements contained in the publisher
      S - the type of the Publisher
      参数:
      publisher - the request body data
      elementClass - the class of elements contained in the publisher
      返回:
      spec for further declaration of the request
    • body

      <T, S extends org.reactivestreams.Publisher<T>> WebTestClient.RequestHeadersSpec<?> body(S publisher, cn.taketoday.core.ParameterizedTypeReference<T> elementTypeRef)
      Variant of body(Publisher, Class) that allows providing element type information with generics.
      类型参数:
      T - the type of the elements contained in the publisher
      S - the type of the Publisher
      参数:
      publisher - the request body data
      elementTypeRef - the type reference of elements contained in the publisher
      返回:
      spec for further declaration of the request
    • body

      WebTestClient.RequestHeadersSpec<?> body(Object producer, Class<?> elementClass)
      Set the body from the given producer. This method invokes the body(Object, Class) method on the underlying WebClient.
      参数:
      producer - the producer to write to the request. This must be a Publisher or another producer adaptable to a Publisher via ReactiveAdapterRegistry
      elementClass - the class of elements contained in the producer
      返回:
      spec for further declaration of the request
    • body

      WebTestClient.RequestHeadersSpec<?> body(Object producer, cn.taketoday.core.ParameterizedTypeReference<?> elementTypeRef)
      Set the body from the given producer. This method invokes the body(Object, TypeReference) method on the underlying WebClient.
      参数:
      producer - the producer to write to the request. This must be a Publisher or another producer adaptable to a Publisher via ReactiveAdapterRegistry
      elementTypeRef - the type reference of elements contained in the producer
      返回:
      spec for further declaration of the request
    • body

      WebTestClient.RequestHeadersSpec<?> body(cn.taketoday.web.reactive.function.BodyInserter<?,? super cn.taketoday.http.client.reactive.ClientHttpRequest> inserter)
      Set the body of the request to the given BodyInserter. This method invokes the body(BodyInserter) method on the underlying WebClient.
      参数:
      inserter - the body inserter to use
      返回:
      spec for further declaration of the request
      另请参阅:
      • BodyInserters