Vipercold
Vipercold

Reputation: 609

How to send form param using scala play 2.4.X WSClient

I'm trying to send form params using WSClient. My first approach is putting all parameters inside a Map:

val params = Map(
  "param1" -> s"${config.param1}",
  "param2" -> s"${config.param2}"
)

ws.url(s"${config.host}").post(params).map { response =>
  response.json.as[MyResponse]

}

It this the right way to do it?

Upvotes: 0

Views: 264

Answers (1)

Cyrille Corpet
Cyrille Corpet

Reputation: 5315

According to the documentation, the entity must be given as a Map[String, Seq[String]].

Upvotes: 2

Related Questions