aboutsummaryrefslogtreecommitdiff
path: root/core
diff options
context:
space:
mode:
authoradamw <adam@warski.org>2017-09-05 16:03:10 +0200
committeradamw <adam@warski.org>2017-09-05 16:03:10 +0200
commit7188ebe102803c7d27c75b4640ded86a2ba7c6f6 (patch)
tree40e59f8be41dd3efd1d438a0eac5de9c531203e1 /core
parentfebcdbcb4448fe1e754ecd08fb4df4bf6c6a211c (diff)
downloadsttp-7188ebe102803c7d27c75b4640ded86a2ba7c6f6.tar.gz
sttp-7188ebe102803c7d27c75b4640ded86a2ba7c6f6.tar.bz2
sttp-7188ebe102803c7d27c75b4640ded86a2ba7c6f6.zip
Tag methods
Diffstat (limited to 'core')
-rw-r--r--core/src/main/scala/com/softwaremill/sttp/RequestT.scala5
1 files changed, 5 insertions, 0 deletions
diff --git a/core/src/main/scala/com/softwaremill/sttp/RequestT.scala b/core/src/main/scala/com/softwaremill/sttp/RequestT.scala
index 27ed7f3..020e926 100644
--- a/core/src/main/scala/com/softwaremill/sttp/RequestT.scala
+++ b/core/src/main/scala/com/softwaremill/sttp/RequestT.scala
@@ -225,6 +225,11 @@ case class RequestT[U[_], T, +S](
def followRedirects(fr: Boolean): RequestT[U, T, S] =
this.copy(options = options.copy(followRedirects = fr))
+ def tag(k: String, v: Any): RequestT[U, T, S] =
+ this.copy(tags = tags + (k -> v))
+
+ def tag(k: String): Option[Any] = tags.get(k)
+
def send[R[_]]()(implicit handler: SttpHandler[R, S],
isIdInRequest: IsIdInRequest[U]): R[Response[T]] = {
// we could avoid the asInstanceOf by creating an artificial copy