sealed trait HttpMessage extends javadsl.model.HttpMessage

Common base class of HttpRequest and HttpResponse.

Source
HttpMessage.scala
Linear Supertypes
Known Subclasses
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. HttpMessage
  2. HttpMessage
  3. AnyRef
  4. Any
Implicitly
  1. by HttpMessageScalaDSLSugar
  2. by any2stringadd
  3. by StringFormat
  4. by Ensuring
  5. by ArrowAssoc
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Type Members

  1. type MessageTransformations[Self] = javadsl.model.HttpMessage.MessageTransformations[Self]
    Attributes
    protected
    Definition Classes
    HttpMessage
  2. abstract type Self <: HttpMessage { type Self = HttpMessage.this.Self }

Abstract Value Members

  1. abstract def entity(): ResponseEntity

    The entity of this message.

    The entity of this message.

    Definition Classes
    HttpMessageHttpMessage
  2. abstract def headers: Seq[HttpHeader]
  3. abstract def isRequest(): Boolean

    Is this instance a request.

    Is this instance a request.

    Definition Classes
    HttpMessageHttpMessage
  4. abstract def isResponse(): Boolean

    Is this instance a response.

    Is this instance a response.

    Definition Classes
    HttpMessageHttpMessage
  5. abstract def protocol(): HttpProtocol

    The protocol of this message.

    The protocol of this message.

    Definition Classes
    HttpMessageHttpMessage
  6. abstract def self: Self
  7. abstract def transformEntityDataBytes[M](transformer: Graph[FlowShape[ByteString, ByteString], M]): Self
  8. abstract def withEntity(entity: MessageEntity): Self

    Returns a copy of this message with the entity set to the given one.

  9. abstract def withHeaders(headers: Seq[HttpHeader]): Self

    Returns a copy of this message with the list of headers set to the given ones.

  10. abstract def withHeadersAndEntity(headers: Seq[HttpHeader], entity: MessageEntity): Self

    Returns a copy of this message with the entity and headers set to the given ones.

Concrete Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int
    Definition Classes
    AnyRef → Any
  3. def +(other: String): String
    Implicit
    This member is added by an implicit conversion from HttpMessage to any2stringadd[HttpMessage] performed by method any2stringadd in scala.Predef.
    Definition Classes
    any2stringadd
  4. def ->[B](y: B): (HttpMessage, B)
    Implicit
    This member is added by an implicit conversion from HttpMessage to ArrowAssoc[HttpMessage] performed by method ArrowAssoc in scala.Predef.
    Definition Classes
    ArrowAssoc
    Annotations
    @inline()
  5. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  6. def addCredentials(credentials: HttpCredentials): Self
  7. def addHeader(header: javadsl.model.HttpHeader): Self
  8. def addHeaders(headers: Iterable[javadsl.model.HttpHeader]): Self

    Java API

  9. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  10. def clone(): AnyRef
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @native() @throws( ... )
  11. def connectionCloseExpected: Boolean

    Returns true if this message is an:

    Returns true if this message is an:

    • HttpRequest and the client does not want to reuse the connection after the response for this request has been received
    • HttpResponse and the server will close the connection after this response
  12. def discardEntityBytes(mat: Materializer): DiscardedEntity

    Discards the entities data bytes by running the dataBytes Source contained in this HttpMessage.

    Discards the entities data bytes by running the dataBytes Source contained in this HttpMessage.

    Note: It is crucial that entities are either discarded, or consumed by running the underlying akka.stream.scaladsl.Source as otherwise the lack of consuming of the data will trigger back-pressure to the underlying TCP connection (as designed), however possibly leading to an idle-timeout that will close the connection, instead of just having ignored the data.

    Warning: It is not allowed to discard and/or consume the entity.dataBytes more than once as the stream is directly attached to the "live" incoming data source from the underlying TCP connection. Allowing it to be consumable twice would require buffering the incoming data, thus defeating the purpose of its streaming nature. If the dataBytes source is materialized a second time, it will fail with an "stream can cannot be materialized more than once" exception.

    When called on Strict entities or sources whose values can be buffered in memory, the above warnings can be ignored. Repeated materialization is not necessary in this case, avoiding the mentioned exceptions due to the data being held in memory.

    In future versions, more automatic ways to warn or resolve these situations may be introduced, see issue #18716.

    Definition Classes
    HttpMessageHttpMessage
  13. def encoding: HttpEncoding

    The content encoding as specified by the Content-Encoding header.

    The content encoding as specified by the Content-Encoding header. If no Content-Encoding header is present the default value 'identity' is returned.

  14. def ensuring(cond: (HttpMessage) ⇒ Boolean, msg: ⇒ Any): HttpMessage
    Implicit
    This member is added by an implicit conversion from HttpMessage to Ensuring[HttpMessage] performed by method Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  15. def ensuring(cond: (HttpMessage) ⇒ Boolean): HttpMessage
    Implicit
    This member is added by an implicit conversion from HttpMessage to Ensuring[HttpMessage] performed by method Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  16. def ensuring(cond: Boolean, msg: ⇒ Any): HttpMessage
    Implicit
    This member is added by an implicit conversion from HttpMessage to Ensuring[HttpMessage] performed by method Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  17. def ensuring(cond: Boolean): HttpMessage
    Implicit
    This member is added by an implicit conversion from HttpMessage to Ensuring[HttpMessage] performed by method Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  18. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  19. def equals(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  20. def finalize(): Unit
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  21. def formatted(fmtstr: String): String
    Implicit
    This member is added by an implicit conversion from HttpMessage to StringFormat[HttpMessage] performed by method StringFormat in scala.Predef.
    Definition Classes
    StringFormat
    Annotations
    @inline()
  22. final def getClass(): Class[_]
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  23. def getHeader(headerName: String): Optional[javadsl.model.HttpHeader]

    Java API

    Java API

    Definition Classes
    HttpMessageHttpMessage
  24. def getHeader[T <: javadsl.model.HttpHeader](headerClass: Class[T]): Optional[T]

    Java API

    Java API

    Definition Classes
    HttpMessageHttpMessage
  25. def getHeaders(): Iterable[javadsl.model.HttpHeader]

    Java API

    Java API

    Definition Classes
    HttpMessageHttpMessage
  26. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  27. def header[T >: Null <: javadsl.model.HttpHeader](implicit arg0: ClassTag[T]): Option[T]

    Returns the first header of the given type if there is one

  28. val httpMessage: HttpMessage
    Implicit
    This member is added by an implicit conversion from HttpMessage to HttpMessageScalaDSLSugar performed by method HttpMessageScalaDSLSugar in akka.http.scaladsl.model.HttpMessage.
    Definition Classes
    HttpMessageScalaDSLSugar
  29. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  30. def mapHeaders(f: (Seq[HttpHeader]) ⇒ Seq[HttpHeader]): Self

    Returns a copy of this message with the list of headers transformed by the given function

  31. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  32. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  33. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  34. def removeHeader(headerName: String): Self

    Removes the header with the given name (case-insensitive)

  35. final def synchronized[T0](arg0: ⇒ T0): T0
    Definition Classes
    AnyRef
  36. def toStrict(timeoutMillis: Long, ec: Executor, materializer: Materializer): CompletionStage[Self]

    Java API

  37. def toStrict(timeout: FiniteDuration)(implicit ec: ExecutionContext, fm: Materializer): Future[Self]

    Returns a shareable and serializable copy of this message with a strict entity.

  38. def toString(): String
    Definition Classes
    AnyRef → Any
  39. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  40. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  41. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @native() @throws( ... )
  42. def withDefaultHeaders(defaultHeaders: Seq[HttpHeader]): Self

    Returns a new message that contains all of the given default headers which didn't already exist (by case-insensitive header name) in this message.

  43. def withDefaultHeaders(defaultHeaders: HttpHeader*): Self

    Returns a new message that contains all of the given default headers which didn't already exist (by case-insensitive header name) in this message.

  44. def withEntity(contentType: javadsl.model.ContentType, file: Path): Self
  45. def withEntity(contentType: javadsl.model.ContentType, file: File): Self
  46. def withEntity(contentType: javadsl.model.ContentType, bytes: ByteString): Self
  47. def withEntity(contentType: javadsl.model.ContentType, bytes: Array[Byte]): Self
  48. def withEntity(contentType: NonBinary, string: String): Self
  49. def withEntity(bytes: ByteString): Self
  50. def withEntity(bytes: Array[Byte]): Self
  51. def withEntity(string: String): Self
  52. def withHeaders(headers: Iterable[javadsl.model.HttpHeader]): Self

    Java API

  53. def withHeaders(headers: HttpHeader*): Self

    Returns a copy of this message with the list of headers set to the given ones.

  54. def [B](y: B): (HttpMessage, B)
    Implicit
    This member is added by an implicit conversion from HttpMessage to ArrowAssoc[HttpMessage] performed by method ArrowAssoc in scala.Predef.
    Definition Classes
    ArrowAssoc

Shadowed Implicit Value Members

  1. def discardEntityBytes()(implicit mat: Materializer): DiscardedEntity

    Discards the entities data bytes by running the dataBytes Source contained by the entity of this HTTP message.

    Discards the entities data bytes by running the dataBytes Source contained by the entity of this HTTP message.

    Note: It is crucial that entities are either discarded, or consumed by running the underlying akka.stream.scaladsl.Source as otherwise the lack of consuming of the data will trigger back-pressure to the underlying TCP connection (as designed), however possibly leading to an idle-timeout that will close the connection, instead of just having ignored the data.

    Warning: It is not allowed to discard and/or consume the entity.dataBytes more than once as the stream is directly attached to the "live" incoming data source from the underlying TCP connection. Allowing it to be consumable twice would require buffering the incoming data, thus defeating the purpose of its streaming nature. If the dataBytes source is materialized a second time, it will fail with an "stream can cannot be materialized more than once" exception.

    When called on Strict entities or sources whose values can be buffered in memory, the above warnings can be ignored. Repeated materialization is not necessary in this case, avoiding the mentioned exceptions due to the data being held in memory.

    In future versions, more automatic ways to warn or resolve these situations may be introduced, see issue #18716.

    Implicit
    This member is added by an implicit conversion from HttpMessage to HttpMessageScalaDSLSugar performed by method HttpMessageScalaDSLSugar in akka.http.scaladsl.model.HttpMessage.
    Shadowing
    This implicitly inherited member is shadowed by one or more members in this class.
    To access this member you can use a type ascription:
    (httpMessage: HttpMessageScalaDSLSugar).discardEntityBytes()(mat)
    Definition Classes
    HttpMessageScalaDSLSugar

Inherited from javadsl.model.HttpMessage

Inherited from AnyRef

Inherited from Any

Inherited by implicit conversion HttpMessageScalaDSLSugar from HttpMessage to HttpMessageScalaDSLSugar

Inherited by implicit conversion any2stringadd from HttpMessage to any2stringadd[HttpMessage]

Inherited by implicit conversion StringFormat from HttpMessage to StringFormat[HttpMessage]

Inherited by implicit conversion Ensuring from HttpMessage to Ensuring[HttpMessage]

Inherited by implicit conversion ArrowAssoc from HttpMessage to ArrowAssoc[HttpMessage]

Ungrouped