接口 MockServerHttpRequest.BodyBuilder

所有超级接口:
MockServerHttpRequest.BaseBuilder<MockServerHttpRequest.BodyBuilder>
所有已知实现类:
MockServerHttpRequest.DefaultBodyBuilder
封闭类:
MockServerHttpRequest

public static interface MockServerHttpRequest.BodyBuilder extends MockServerHttpRequest.BaseBuilder<MockServerHttpRequest.BodyBuilder>
A builder that adds a body to the request.
  • 方法详细资料

    • contentLength

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

      MockServerHttpRequest.BodyBuilder contentType(cn.taketoday.http.MediaType contentType)
      Set the media type of the body, as specified by the Content-Type header.
      参数:
      contentType - the content type
      返回:
      this builder
      另请参阅:
      • HttpHeaders.setContentType(MediaType)
    • body

      MockServerHttpRequest body(org.reactivestreams.Publisher<? extends cn.taketoday.core.io.buffer.DataBuffer> body)
      Set the body of the request and build it.
      参数:
      body - the body
      返回:
      the built request entity
    • body

      Set 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 - the body as text
      返回:
      the built request entity