View Javadoc

1   package com.atlassian.marketplace.client.http;
2   
3   import java.io.Closeable;
4   import java.io.InputStream;
5   
6   import com.atlassian.marketplace.client.MpacException;
7   
8   /**
9    * A simple abstraction of an HTTP response.
10   * @since 2.0.0
11   */
12  public interface SimpleHttpResponse extends Closeable
13  {
14      /**
15       * The status code of the response.
16       */
17      int getStatus();
18      
19      /**
20       * An input stream for the response body.
21       */
22      InputStream getContentStream() throws MpacException;
23      
24      /**
25       * Returns all header values for the given header name.
26       */
27      Iterable<String> getHeader(String name);
28      
29      /**
30       * True if the response has a zero-length body.
31       */
32      boolean isEmpty();
33      
34      /**
35       * Ensures that the input stream is closed.
36       */
37      void close();
38  }