Interface HttpBody

All Superinterfaces:
AutoCloseable, Closeable, Releasable
All Known Subinterfaces:
HttpBody.Full, HttpBody.Stream
All Known Implementing Classes:
HttpBody.ByteRefHttpBody

public sealed interface HttpBody extends Releasable permits HttpBody.Full, HttpBody.Stream
A super-interface for different HTTP content implementations
  • Method Details

    • fromBytesReference

      static HttpBody.Full fromBytesReference(BytesReference bytesRef)
    • empty

      static HttpBody.Full empty()
    • isFull

      default boolean isFull()
    • isEmpty

      default boolean isEmpty()
    • isStream

      default boolean isStream()
    • asFull

      default HttpBody.Full asFull()
      Assumes that HTTP body is a full content. If not sure, use isFull().
    • asStream

      default HttpBody.Stream asStream()
      Assumes that HTTP body is a lazy-stream. If not sure, use isStream().