Class BasicClassicHttpResponse

All Implemented Interfaces:
Closeable, Serializable, AutoCloseable, ClassicHttpResponse, HttpEntityContainer, HttpMessage, HttpResponse, MessageHeaders

public class BasicClassicHttpResponse extends BasicHttpResponse implements ClassicHttpResponse
Basic implementation of ClassicHttpResponse.
Since:
5.0
See Also:
  • Field Details

  • Constructor Details

    • BasicClassicHttpResponse

      public BasicClassicHttpResponse(int code, ReasonPhraseCatalog catalog, Locale locale)
      Creates a new response.
      Parameters:
      code - the status code
      catalog - the reason phrase catalog, or null to disable automatic reason phrase lookup
      locale - the locale for looking up reason phrases, or null for the system locale
    • BasicClassicHttpResponse

      public BasicClassicHttpResponse(int code, String reasonPhrase)
      Creates a new response.
      Parameters:
      code - the status code of the response
      reasonPhrase - the reason phrase to the status code, or null
    • BasicClassicHttpResponse

      public BasicClassicHttpResponse(int code)
      Creates a new response.
      Parameters:
      code - the status code of the response
  • Method Details

    • getEntity

      public HttpEntity getEntity()
      Description copied from interface: HttpEntityContainer
      Obtains the message entity, if available.
      Specified by:
      getEntity in interface HttpEntityContainer
      Returns:
      the message entity, or null if not available
    • setEntity

      public void setEntity(HttpEntity entity)
      Description copied from interface: HttpEntityContainer
      Sets an entity for this message.

      Please note that if an entity has already been set it is responsibility of the caller to ensure release of the resources that may be associated with that entity.

      Specified by:
      setEntity in interface HttpEntityContainer
      Parameters:
      entity - the entity to set of this message, or null to unset
    • close

      public void close() throws IOException
      Specified by:
      close in interface AutoCloseable
      Specified by:
      close in interface Closeable
      Throws:
      IOException