Package akka.http.javadsl.model
Interface HttpMessage.MessageTransformations<Self>
- All Known Implementing Classes:
HttpRequest
,HttpRequest
,HttpResponse
,HttpResponse
- Enclosing interface:
- HttpMessage
public static interface HttpMessage.MessageTransformations<Self>
-
Method Summary
Modifier and TypeMethodDescription<T> Self
addAttribute
(AttributeKey<T> key, T value) addCredentials
(HttpCredentials credentials) Returns a copy of this message with the given http credential header added to the list of headers.addHeader
(HttpHeader header) Returns a copy of this message with the given header added to the list of headers.addHeaders
(Iterable<HttpHeader> headers) Returns a copy of this message with the given headers added to the list of headers.removeAttribute
(AttributeKey<?> key) Returns a copy of this message with the attribute with this key (if any) removed.removeHeader
(String headerName) Returns a copy of this message with all headers of the given name (case-insensitively) removed.CompletionStage<? extends Self>
toStrict
(long timeoutMillis, long maxBytes, akka.actor.ClassicActorSystemProvider system) Returns a CompletionStage of Self message with strict entity that contains the same data as this entity which is only completed when the complete entity has been collected.CompletionStage<? extends Self>
Returns a CompletionStage of Self message with strict entity that contains the same data as this entity which is only completed when the complete entity has been collected.CompletionStage<? extends Self>
toStrict
(long timeoutMillis, akka.actor.ClassicActorSystemProvider system) Returns a CompletionStage of Self message with strict entity that contains the same data as this entity which is only completed when the complete entity has been collected.CompletionStage<? extends Self>
Returns a CompletionStage of Self message with strict entity that contains the same data as this entity which is only completed when the complete entity has been collected.<T> Self
transformEntityDataBytes
(akka.stream.Graph<akka.stream.FlowShape<akka.util.ByteString, akka.util.ByteString>, T> transformer) Returns a copy of Self message after applying the given transformationwithEntity
(byte[] bytes) Returns a copy of Self message with a new entity.withEntity
(ContentType.NonBinary type, String string) Returns a copy of Self message with a new entity.withEntity
(ContentType type, byte[] bytes) Returns a copy of Self message with a new entity.withEntity
(ContentType type, akka.util.ByteString bytes) Returns a copy of Self message with a new entity.withEntity
(ContentType type, File file) Returns a copy of Self message with a new entity.withEntity
(ContentType type, Path file) Returns a copy of Self message with a new entity.withEntity
(RequestEntity entity) Returns a copy of Self message with a new entity.withEntity
(akka.util.ByteString bytes) Returns a copy of Self message with a new entity.withEntity
(String string) Returns a copy of this message with a new entity.withHeaders
(Iterable<HttpHeader> headers) Returns a copy of this message with new headers.withProtocol
(HttpProtocol protocol) Returns a copy of this message with a new protocol.
-
Method Details
-
withProtocol
Returns a copy of this message with a new protocol. -
addHeader
Returns a copy of this message with the given header added to the list of headers. -
addHeaders
Returns a copy of this message with the given headers added to the list of headers. -
withHeaders
Returns a copy of this message with new headers. -
addAttribute
-
addCredentials
Returns a copy of this message with the given http credential header added to the list of headers. -
removeHeader
Returns a copy of this message with all headers of the given name (case-insensitively) removed. -
removeAttribute
Returns a copy of this message with the attribute with this key (if any) removed. -
withEntity
Returns a copy of this message with a new entity. -
withEntity
Returns a copy of Self message with a new entity. -
withEntity
Returns a copy of Self message with a new entity. -
withEntity
Returns a copy of Self message with a new entity. -
withEntity
Returns a copy of Self message with a new entity. -
withEntity
Returns a copy of Self message with a new entity. -
withEntity
Returns a copy of Self message with a new entity. -
withEntity
Returns a copy of Self message with a new entity. -
withEntity
Returns a copy of Self message with a new entity. -
transformEntityDataBytes
<T> Self transformEntityDataBytes(akka.stream.Graph<akka.stream.FlowShape<akka.util.ByteString, akka.util.ByteString>, T> transformer) Returns a copy of Self message after applying the given transformation -
toStrict
CompletionStage<? extends Self> toStrict(long timeoutMillis, Executor ec, akka.stream.Materializer materializer) Returns a CompletionStage of Self message with strict entity that contains the same data as this entity which is only completed when the complete entity has been collected. As the duration of receiving the complete entity cannot be predicted, a timeout needs to be specified to guard the process against running and keeping resources infinitely. Use getEntity().getDataBytes and stream processing instead if the expected data is big or is likely to take a long time. -
toStrict
CompletionStage<? extends Self> toStrict(long timeoutMillis, long maxBytes, Executor ec, akka.stream.Materializer materializer) Returns a CompletionStage of Self message with strict entity that contains the same data as this entity which is only completed when the complete entity has been collected. As the duration of receiving the complete entity cannot be predicted, a timeout needs to be specified to guard the process against running and keeping resources infinitely. Use getEntity().getDataBytes and stream processing instead if the expected data is big or is likely to take a long time. -
toStrict
CompletionStage<? extends Self> toStrict(long timeoutMillis, akka.actor.ClassicActorSystemProvider system) Returns a CompletionStage of Self message with strict entity that contains the same data as this entity which is only completed when the complete entity has been collected. As the duration of receiving the complete entity cannot be predicted, a timeout needs to be specified to guard the process against running and keeping resources infinitely. Use getEntity().getDataBytes and stream processing instead if the expected data is big or is likely to take a long time. -
toStrict
CompletionStage<? extends Self> toStrict(long timeoutMillis, long maxBytes, akka.actor.ClassicActorSystemProvider system) Returns a CompletionStage of Self message with strict entity that contains the same data as this entity which is only completed when the complete entity has been collected. As the duration of receiving the complete entity cannot be predicted, a timeout needs to be specified to guard the process against running and keeping resources infinitely. Use getEntity().getDataBytes and stream processing instead if the expected data is big or is likely to take a long time.
-