接口 RestClient.RequestBodySpec
- 所有已知子接口:
RestClient.RequestBodyUriSpec
- 封闭接口:
- RestClient
public static interface RestClient.RequestBodySpec
extends RestClient.RequestHeadersSpec<RestClient.RequestBodySpec>
Contract for specifying request headers and body leading up to the exchange.
-
嵌套类概要
从接口继承的嵌套类/接口 cn.taketoday.web.client.RestClient.RequestHeadersSpec
RestClient.RequestHeadersSpec.ExchangeFunction<T> -
方法概要
修饰符和类型方法说明Set the body of the response to the given function that writes to anOutputStream.Set the body of the request to the givenObject.body(T body, cn.taketoday.core.ParameterizedTypeReference<T> bodyType) Set the body of the response to the givenObject.contentLength(long contentLength) Set the length of the body in bytes, as specified by theContent-Lengthheader.contentType(MediaType contentType) Set the media type of the body, as specified by theContent-Typeheader.从接口继承的方法 cn.taketoday.web.client.RestClient.RequestHeadersSpec
accept, acceptCharset, attribute, attributes, exchange, exchange, execute, execute, header, headers, httpRequest, ifModifiedSince, ifNoneMatch, retrieve
-
方法详细资料
-
contentLength
Set the length of the body in bytes, as specified by theContent-Lengthheader.- 参数:
contentLength- the content length- 返回:
- this builder
- 另请参阅:
-
contentType
Set the media type of the body, as specified by theContent-Typeheader.- 参数:
contentType- the content type- 返回:
- this builder
- 另请参阅:
-
body
Set the body of the request to the givenObject. For example:Person person = ... ; ResponseEntity<Void> response = client.post() .uri("/persons/{id}", id) .contentType(MediaType.APPLICATION_JSON) .body(person) .retrieve() .toBodilessEntity();- 参数:
body- the body of the response- 返回:
- the built response
-
body
<T> RestClient.RequestBodySpec body(T body, cn.taketoday.core.ParameterizedTypeReference<T> bodyType) Set the body of the response to the givenObject. The parameterbodyTypeis used to capture the generic type.- 参数:
body- the body of the responsebodyType- the type of the body, used to capture the generic type- 返回:
- the built response
-
body
Set the body of the response to the given function that writes to anOutputStream.- 参数:
body- a function that takes anOutputStreamand can throw anIOException- 返回:
- the built response
-