パッケージ org.springframework.http

インターフェース ResponseEntity.BodyBuilder

すべてのスーパーインターフェース:
ResponseEntity.HeadersBuilder<ResponseEntity.BodyBuilder>
含まれているクラス:
ResponseEntity<T>

public static interface ResponseEntity.BodyBuilder extends ResponseEntity.HeadersBuilder<ResponseEntity.BodyBuilder>
レスポンスエンティティに本文を追加するビルダーを定義します。
導入:
4.1
  • メソッドの詳細

    • contentLength

      ResponseEntity.BodyBuilder contentLength(long contentLength)
      Content-Length ヘッダーで指定されているように、本文の長さをバイト単位で設定します。
      パラメーター:
      contentLength - コンテンツの長さ
      戻り値:
      このビルダー
      関連事項:
    • contentType

      ResponseEntity.BodyBuilder contentType(MediaType contentType)
      Content-Type ヘッダーで指定されているように、本文のメディア型を設定します。
      パラメーター:
      contentType - コンテンツ型
      戻り値:
      このビルダー
      関連事項:
    • body

      <T> ResponseEntity<T> body(@Nullable T body)
      レスポンスエンティティの本体を設定して返します。
      型パラメーター:
      T - 体の種類
      パラメーター:
      body - レスポンスエンティティの本体
      戻り値:
      構築されたレスポンスエンティティ