Last active
October 7, 2020 12:13
-
-
Save jamesward/4934376eecb1fe2230b9da0690a3c43e to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
case class WSRequest(url: String, headers: Map[String, String] = Map.empty) { | |
def withHeaders(_headers: (String, String)*): WSRequest = { | |
copy(headers = Map.from(_headers)) | |
} | |
} | |
val r0 = WSRequest("asdf", Map("foo" -> "bar")) | |
val r1 = WSRequest("asdf") | |
val r2 = r1.withHeaders("foo" -> "bar") // syntactic sugar for r1.copy(headers = ...) | |
(r0 == r2) == true | |
(r1 == r2) == false |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment