When I try to pass a Map to a post, I get this error:
Cannot write an instance of scala.collection.immutable.Map[java.lang.String,java.lang.String] to HTTP response. Try to define a Writeable[scala.collection.immutable.Map[java.lang.String,java.lang.String]]
Here is my post example:
WS.url("http://mysql/endpoint")
.post(Map("email" -> "[email protected]")).map { response =>
Logger.logger.debug("response: " + response.body)
}
What is happening?
Here is the tips: you must send Map[String, Seq[String]]
WS.url("http://mysql/endpoint")
.post(Map("email" -> Seq("[email protected]"))).map { response =>
Logger.logger.debug("response: " + response.body)
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With