public final class HttpResponse extends HttpResponse implements HttpMessage
HttpMessage.DiscardedEntity, HttpMessage.HttpMessageScalaDSLSugar, HttpMessage.HttpMessageScalaDSLSugar$
HttpMessage.MessageTransformations<Self>
Constructor and Description |
---|
HttpResponse(StatusCode status,
scala.collection.immutable.Seq<HttpHeader> headers,
scala.collection.immutable.Map<AttributeKey<?>,java.lang.Object> attributes,
ResponseEntity entity,
HttpProtocol protocol) |
HttpResponse(StatusCode status,
scala.collection.immutable.Seq<HttpHeader> headers,
ResponseEntity entity,
HttpProtocol protocol)
Deprecated.
use the constructor that includes an attributes parameter instead. Since Akka HTTP 10.2.0.
|
Modifier and Type | Method and Description |
---|---|
StatusCode |
_1() |
scala.collection.immutable.Seq<HttpHeader> |
_2() |
ResponseEntity |
_3() |
HttpProtocol |
_4() |
static HttpResponse |
apply(StatusCode status,
scala.collection.immutable.Seq<HttpHeader> headers,
ResponseEntity entity,
HttpProtocol protocol) |
scala.collection.immutable.Map<AttributeKey<?>,java.lang.Object> |
attributes() |
HttpResponse |
copy(StatusCode status,
scala.collection.immutable.Seq<HttpHeader> headers,
ResponseEntity entity,
HttpProtocol protocol)
Deprecated.
Use the `withXYZ` methods instead. Since Akka HTTP 10.2.0.
|
ResponseEntity |
entity()
Returns the entity of this response.
|
boolean |
equals(java.lang.Object obj) |
int |
hashCode() |
scala.collection.immutable.Seq<HttpHeader> |
headers() |
boolean |
isRequest()
Is this instance a request.
|
boolean |
isResponse()
Is this instance a response.
|
HttpResponse |
mapEntity(scala.Function1<ResponseEntity,ResponseEntity> f) |
HttpProtocol |
protocol()
The protocol of this message.
|
HttpResponse |
self() |
StatusCode |
status()
Returns the status-code of this response.
|
java.lang.String |
toString() |
<T> HttpResponse |
transformEntityDataBytes(org.apache.pekko.stream.Graph<org.apache.pekko.stream.FlowShape<org.apache.pekko.util.ByteString,org.apache.pekko.util.ByteString>,T> transformer)
Returns a copy of Self message after applying the given transformation
|
static OptHttpResponse |
unapply(HttpResponse any) |
HttpResponse |
withAttributes(scala.collection.immutable.Map<AttributeKey<?>,java.lang.Object> attributes)
Returns a copy of this message with the attributes set to the given ones.
|
HttpResponse |
withEntity(RequestEntity entity)
Returns a copy of this message with the entity set to the given one.
|
HttpResponse |
withEntity(RequestEntity entity)
Returns a copy of Self message with a new entity.
|
HttpResponse |
withEntity(ResponseEntity entity)
Returns a copy of this instance with a new entity.
|
HttpResponse |
withHeaders(scala.collection.immutable.Seq<HttpHeader> headers)
Returns a copy of this message with the list of headers set to the given ones.
|
HttpResponse |
withHeadersAndEntity(scala.collection.immutable.Seq<HttpHeader> headers,
RequestEntity entity)
Returns a copy of this message with the entity and headers set to the given ones.
|
HttpResponse |
withHeadersAndEntity(scala.collection.immutable.Seq<HttpHeader> headers,
ResponseEntity entity) |
HttpResponse |
withProtocol(HttpProtocol protocol)
Returns a copy of this message with a new protocol.
|
HttpResponse |
withProtocol(HttpProtocol protocol) |
HttpResponse |
withStatus(int statusCode)
Returns a copy of this instance with a new status-code.
|
HttpResponse |
withStatus(StatusCode statusCode)
Returns a copy of this instance with a new status-code.
|
create, encoding
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
addAttribute, addCredentials, addHeader, addHeaders, attribute, connectionCloseExpected, discardEntityBytes, discardEntityBytes, encoding, getAttribute, getHeader, getHeader, getHeaders, getHeaders, header, headers, mapAttributes, mapHeaders, removeAttribute, removeHeader, toStrict, toStrict, toStrict, toStrict, toStrict, toStrict, withDefaultHeaders, withDefaultHeaders, withEntity, withEntity, withEntity, withEntity, withEntity, withEntity, withEntity, withEntity, withHeaders, withHeaders
addAttribute, addCredentials, addHeader, addHeaders, removeAttribute, removeHeader, toStrict, toStrict, toStrict, toStrict, withEntity, withEntity, withEntity, withEntity, withEntity, withEntity, withEntity, withEntity, withHeaders
public HttpResponse(StatusCode status, scala.collection.immutable.Seq<HttpHeader> headers, scala.collection.immutable.Map<AttributeKey<?>,java.lang.Object> attributes, ResponseEntity entity, HttpProtocol protocol)
public HttpResponse(StatusCode status, scala.collection.immutable.Seq<HttpHeader> headers, ResponseEntity entity, HttpProtocol protocol)
public static HttpResponse apply(StatusCode status, scala.collection.immutable.Seq<HttpHeader> headers, ResponseEntity entity, HttpProtocol protocol)
public static OptHttpResponse unapply(HttpResponse any)
public StatusCode status()
HttpResponse
status
in class HttpResponse
public scala.collection.immutable.Seq<HttpHeader> headers()
public scala.collection.immutable.Map<AttributeKey<?>,java.lang.Object> attributes()
public ResponseEntity entity()
HttpResponse
entity
in interface HttpMessage
entity
in class HttpResponse
public HttpProtocol protocol()
HttpMessage
protocol
in interface HttpMessage
public HttpResponse self()
public boolean isRequest()
HttpMessage
isRequest
in interface HttpMessage
public boolean isResponse()
HttpMessage
isResponse
in interface HttpMessage
public HttpResponse withHeaders(scala.collection.immutable.Seq<HttpHeader> headers)
HttpMessage
public HttpResponse withAttributes(scala.collection.immutable.Map<AttributeKey<?>,java.lang.Object> attributes)
HttpMessage
public HttpResponse withProtocol(HttpProtocol protocol)
HttpMessage.MessageTransformations
withProtocol
in interface HttpMessage.MessageTransformations<HttpResponse>
public HttpResponse withProtocol(HttpProtocol protocol)
public HttpResponse withStatus(int statusCode)
HttpResponse
withStatus
in class HttpResponse
public HttpResponse withStatus(StatusCode statusCode)
HttpResponse
withStatus
in class HttpResponse
public HttpResponse withHeadersAndEntity(scala.collection.immutable.Seq<HttpHeader> headers, RequestEntity entity)
HttpMessage
public HttpResponse withHeadersAndEntity(scala.collection.immutable.Seq<HttpHeader> headers, ResponseEntity entity)
public HttpResponse withEntity(ResponseEntity entity)
HttpResponse
withEntity
in class HttpResponse
public HttpResponse withEntity(RequestEntity entity)
HttpMessage
public HttpResponse withEntity(RequestEntity entity)
HttpMessage.MessageTransformations
withEntity
in interface HttpMessage.MessageTransformations<HttpResponse>
public HttpResponse mapEntity(scala.Function1<ResponseEntity,ResponseEntity> f)
public <T> HttpResponse transformEntityDataBytes(org.apache.pekko.stream.Graph<org.apache.pekko.stream.FlowShape<org.apache.pekko.util.ByteString,org.apache.pekko.util.ByteString>,T> transformer)
HttpMessage.MessageTransformations
transformEntityDataBytes
in interface HttpMessage.MessageTransformations<HttpResponse>
public HttpResponse copy(StatusCode status, scala.collection.immutable.Seq<HttpHeader> headers, ResponseEntity entity, HttpProtocol protocol)
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object
public StatusCode _1()
public scala.collection.immutable.Seq<HttpHeader> _2()
public ResponseEntity _3()
public HttpProtocol _4()