接口 RequestEntity.BodyBuilder

所有超级接口:
RequestEntity.HeadersBuilder<RequestEntity.BodyBuilder>
所有已知实现类:
RequestEntity.DefaultBodyBuilder
封闭类:
RequestEntity<T>

public static interface RequestEntity.BodyBuilder extends RequestEntity.HeadersBuilder<RequestEntity.BodyBuilder>
Defines a builder that adds a body to the response entity.
  • 方法详细资料

    • contentLength

      RequestEntity.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
      另请参阅:
    • contentType

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

      <T> RequestEntity<T> body(T body)
      Set the body of the request entity and build the RequestEntity.
      类型参数:
      T - the type of the body
      参数:
      body - the body of the request entity
      返回:
      the built request entity
    • body

      <T> RequestEntity<T> body(T body, Type type)
      Set the body and type of the request entity and build the RequestEntity.
      类型参数:
      T - the type of the body
      参数:
      body - the body of the request entity
      type - the type of the body, useful for generic type resolution
      返回:
      the built request entity