Class HttpResponse

java.lang.Object
akka.http.javadsl.model.HttpResponse
All Implemented Interfaces:
HttpMessage, HttpMessage.MessageTransformations<HttpResponse>
Direct Known Subclasses:
HttpResponse

public abstract class HttpResponse extends Object implements HttpMessage, HttpMessage.MessageTransformations<HttpResponse>
Represents an Http response.
  • Constructor Details

    • HttpResponse

      public HttpResponse()
  • Method Details

    • status

      public abstract StatusCode status()
      Returns the status-code of this response.
    • entity

      public abstract ResponseEntity entity()
      Returns the entity of this response.
      Specified by:
      entity in interface HttpMessage
    • withStatus

      public abstract HttpResponse withStatus(StatusCode statusCode)
      Returns a copy of this instance with a new status-code.
    • withStatus

      public abstract HttpResponse withStatus(int statusCode)
      Returns a copy of this instance with a new status-code.
    • withEntity

      public abstract HttpResponse withEntity(ResponseEntity entity)
      Returns a copy of this instance with a new entity.
    • encoding

      public abstract HttpEncoding encoding()
      Returns the content encoding as specified by the Content-Encoding header. If no Content-Encoding header is present the default value 'identity' is returned.
    • create

      public static HttpResponse create()
      Returns a default response to be changed using the `withX` methods.