Package akka.http.javadsl.model
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 java.lang.Object implements HttpMessage, HttpMessage.MessageTransformations<HttpResponse>
Represents an Http response.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface akka.http.javadsl.model.HttpMessage
HttpMessage.DiscardedEntity, HttpMessage.MessageTransformations<Self>
-
-
Constructor Summary
Constructors Constructor Description HttpResponse()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description static HttpResponse
create()
Returns a default response to be changed using the `withX` methods.abstract HttpEncoding
encoding()
Returns the content encoding as specified by the Content-Encoding header.abstract ResponseEntity
entity()
Returns the entity of this response.abstract StatusCode
status()
Returns the status-code of this response.abstract HttpResponse
withEntity(ResponseEntity entity)
Returns a copy of this instance with a new entity.abstract HttpResponse
withStatus(int statusCode)
Returns a copy of this instance with a new status-code.abstract HttpResponse
withStatus(StatusCode statusCode)
Returns a copy of this instance with a new status-code.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface akka.http.javadsl.model.HttpMessage
discardEntityBytes, discardEntityBytes, getAttribute, getHeader, getHeader, getHeaders, getHeaders, isRequest, isResponse, protocol
-
Methods inherited from interface akka.http.javadsl.model.HttpMessage.MessageTransformations
addAttribute, addCredentials, addHeader, addHeaders, removeAttribute, removeHeader, toStrict, toStrict, toStrict, toStrict, transformEntityDataBytes, withEntity, withEntity, withEntity, withEntity, withEntity, withEntity, withEntity, withEntity, withEntity, withHeaders, withProtocol
-
-
-
-
Method Detail
-
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 interfaceHttpMessage
-
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.
-
-