Passing scala map as request body in POST call

I am having a map Map[String, String] in scala and it is set in the session

I have to pass this map as request body of POST call


This is giving 400 Bad request

on Debugging, I found out the request body is being sent as:

{ “key1” → value1, “key2” → value2}

But, request body should have format like below to work.
{ “key1” : “value1”, “key2” : “value2”}

Use -

formParamMap(map: Expression[Map[String, Any]]):

http("My Form Data")
  .formParamMap(Map("myKey" -> "myValue", "anotherKey" -> "anotherValue"))