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, encodingclone, finalize, getClass, notify, notifyAll, wait, wait, waitaddAttribute, 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, withHeadersaddAttribute, addCredentials, addHeader, addHeaders, removeAttribute, removeHeader, toStrict, toStrict, toStrict, toStrict, withEntity, withEntity, withEntity, withEntity, withEntity, withEntity, withEntity, withEntity, withHeaderspublic 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()
HttpResponsestatus in class HttpResponsepublic scala.collection.immutable.Seq<HttpHeader> headers()
public scala.collection.immutable.Map<AttributeKey<?>,java.lang.Object> attributes()
public ResponseEntity entity()
HttpResponseentity in interface HttpMessageentity in class HttpResponsepublic HttpProtocol protocol()
HttpMessageprotocol in interface HttpMessagepublic HttpResponse self()
public boolean isRequest()
HttpMessageisRequest in interface HttpMessagepublic boolean isResponse()
HttpMessageisResponse in interface HttpMessagepublic HttpResponse withHeaders(scala.collection.immutable.Seq<HttpHeader> headers)
HttpMessagepublic HttpResponse withAttributes(scala.collection.immutable.Map<AttributeKey<?>,java.lang.Object> attributes)
HttpMessagepublic HttpResponse withProtocol(HttpProtocol protocol)
HttpMessage.MessageTransformationswithProtocol in interface HttpMessage.MessageTransformations<HttpResponse>public HttpResponse withProtocol(HttpProtocol protocol)
public HttpResponse withStatus(int statusCode)
HttpResponsewithStatus in class HttpResponsepublic HttpResponse withStatus(StatusCode statusCode)
HttpResponsewithStatus in class HttpResponsepublic HttpResponse withHeadersAndEntity(scala.collection.immutable.Seq<HttpHeader> headers, RequestEntity entity)
HttpMessagepublic HttpResponse withHeadersAndEntity(scala.collection.immutable.Seq<HttpHeader> headers, ResponseEntity entity)
public HttpResponse withEntity(ResponseEntity entity)
HttpResponsewithEntity in class HttpResponsepublic HttpResponse withEntity(RequestEntity entity)
HttpMessagepublic HttpResponse withEntity(RequestEntity entity)
HttpMessage.MessageTransformationswithEntity 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.MessageTransformationstransformEntityDataBytes 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.Objectpublic int hashCode()
hashCode in class java.lang.Objectpublic java.lang.String toString()
toString in class java.lang.Objectpublic StatusCode _1()
public scala.collection.immutable.Seq<HttpHeader> _2()
public ResponseEntity _3()
public HttpProtocol _4()