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 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 -
Method Summary
Modifier and TypeMethodDescriptionstatic 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
-
Constructor Details
-
HttpResponse
public HttpResponse()
-
-
Method Details
-
status
Returns the status-code of this response. -
entity
Returns the entity of this response.- Specified by:
entity
in interfaceHttpMessage
-
withStatus
Returns a copy of this instance with a new status-code. -
withStatus
Returns a copy of this instance with a new status-code. -
withEntity
Returns a copy of this instance with a new entity. -
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
Returns a default response to be changed using the `withX` methods.
-