Schnittstelle HttpConnection

Alle Superschnittstellen:
AutoCloseable

public interface HttpConnection extends AutoCloseable
Wrapper for an open HTTP protocol connection.
Autor:
Stephan Fuhrmann
  • Methodendetails

    • getURI

      URI getURI() throws IOException
      Get the URL being associated to this connection.
      Gibt zurück:
      the URL associated with this connection.
      Löst aus:
      IOException - if resolving the URL resulted in an error.
    • getHeaderFields

      Map<String,List<String>> getHeaderFields()
      Get the response header fields from the HTTP server.
      Gibt zurück:
      a map with the keys being headers field names and the values being header field values. If a header field is given multiple times the value list will contain all values.
    • getInputStream

      InputStream getInputStream() throws IOException
      Get the input stream reading the HTTP response body.
      Gibt zurück:
      the input stream of the connection.
      Löst aus:
      IOException - if there's a problem getting or opening the input stream.
    • getContentType

      String getContentType()
      Get the content type of the stream.
      Gibt zurück:
      the content type, for example "audio/mpeg", or null if not sent by the server.
    • getResponseCode

      int getResponseCode() throws IOException
      Get the HTTP server response code.
      Gibt zurück:
      the numerical response code, for example 200 for "OK".
      Löst aus:
      IOException - if there is a problem getting the response code.
      Siehe auch:
    • getResponseMessage

      String getResponseMessage() throws IOException
      Get the HTTP server response status message.
      Gibt zurück:
      the textual response message, for example "OK".
      Löst aus:
      IOException - if there is a problem getting the response message.
      Siehe auch:
    • close

      void close() throws IOException
      Angegeben von:
      close in Schnittstelle AutoCloseable
      Löst aus:
      IOException