Interface RequestBody

All Superinterfaces:
AutoCloseable, Closeable

public interface RequestBody extends Closeable
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Closes this RequestBody and releases all resources.
    default OptionalLong
    Returns the content length, if known.
    A HTTP/Conjure content type (e.g., "application/json") indicating the type of content.
    boolean
    Returns
    void
    The content of this request body, possibly empty.
  • Method Details

    • writeTo

      void writeTo(OutputStream output) throws IOException
      The content of this request body, possibly empty.
      Throws:
      IOException
    • contentType

      String contentType()
      A HTTP/Conjure content type (e.g., "application/json") indicating the type of content.
    • repeatable

      boolean repeatable()
      Returns
      true
      if writeTo(OutputStream) may be invoked multiple times.
    • contentLength

      default OptionalLong contentLength()
      Returns the content length, if known.
    • close

      void close()
      Closes this RequestBody and releases all resources. Calling close() should never throw, preferring to catch and log.
      Specified by:
      close in interface AutoCloseable
      Specified by:
      close in interface Closeable