v13.0.0
What's New?
Use Seq[T] and T*
This release's primary focus is to DX-related optimizations. In particular, many of the library's interfaces now accept Seq[T]
for parameter values where previously only T*
was accepted.
For example, withHeaders
in HttpMessage
previously accepted Header*
only, which meant that if you already had headers tucked away in a Seq
, you'd need to spread the elements out using _*
.
val headers = Seq(
Header("Accept", "application/json"),
Header("Accept-Encoding", "gzip")
)
val request = GET("https://localhost:9000/messages")
.withHeaders(headers : _*) // Spread out Seq of headers
This is no longer required.
val headers = Seq(
Header("Accept", "application/json"),
Header("Accept-Encoding", "gzip")
)
val request = GET("https://localhost:9000/messages")
.withHeaders(headers) // No need to spread
And, if needed, you can still pass in a variable argument list.
val request = GET("https://localhost:9000/messages")
.withHeaders(Header("Accept", "application/json"), Header("Accept-Encoding", "gzip"))
New WebSocket headers
Additional -Client
and -Server
WebSocket headers are available, along with the WebSocketExtension
type, which is now used for Sec-WebSocket-Extensions
header values.