Interface Response

All Superinterfaces:
AutoCloseable, Closeable

public interface Response extends Closeable
  • Method Summary

    Modifier and Type
    Method
    Description
    The mutable response attachments.
    The HTTP body for this response.
    void
    Releases all resources associated with this response.
    int
    The HTTP response code for this response.
    default Optional<String>
    Retrieves the first value from the header map for the given key.
    com.google.common.collect.ListMultimap<String,String>
    The HTTP headers for this response.
  • Method Details

    • body

      InputStream body()
      The HTTP body for this response.
    • code

      int code()
      The HTTP response code for this response.
    • headers

      com.google.common.collect.ListMultimap<String,String> headers()
      The HTTP headers for this response. Headers names are compared in a case-insensitive fashion as per https://tools.ietf.org/html/rfc7540#section-8.1.2.
    • getFirstHeader

      default Optional<String> getFirstHeader(String header)
      Retrieves the first value from the header map for the given key.
    • attachments

      ResponseAttachments attachments()
      The mutable response attachments.
    • close

      void close()
      Releases all resources associated with this response. If the body() is still open, close() should close the stream. Implementations must not throw, preferring to catch and log internally. Note that in the case of binary and optional binary endpoints, this method may not be called as the user is expected to close the body() themselves.
      Specified by:
      close in interface AutoCloseable
      Specified by:
      close in interface Closeable