接口 MockServerHttpRequest.BodyBuilder
public static interface MockServerHttpRequest.BodyBuilder
extends MockServerHttpRequest.BaseBuilder<MockServerHttpRequest.BodyBuilder>
A builder that adds a body to the request.
-
方法概要
修饰符和类型方法说明Set 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.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.从接口继承的方法 cn.taketoday.mock.http.server.reactive.MockServerHttpRequest.BaseBuilder
accept, acceptCharset, acceptLanguageAsLocales, build, contextPath, cookie, cookies, header, headers, ifModifiedSince, ifNoneMatch, ifUnmodifiedSince, localAddress, queryParam, queryParams, range, remoteAddress, sslInfo
-
方法详细资料
-
contentLength
Set the length of the body in bytes, as specified by theContent-Lengthheader.- 参数:
contentLength- the content length- 返回:
- this builder
- 另请参阅:
-
HttpHeaders.setContentLength(long)
-
contentType
Set the media type of the body, as specified by theContent-Typeheader.- 参数:
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
-