I am using the game! using scala and trying to create proxies for HTTP requests, GET and POST.
The GET actions seem to work, the problem is with the POST action, where I cannot pass the request payload.
I tried several things, for example, the code below, but no one works.
def postAction(query: String) = Action.async { implicit request => val data = if (request.body.asText != None) request.body.asText.get else "" WS.url(DEMO_URL + query).post(data).map(resp => Ok(resp.body).as("application/json")) }
The last thing to mention is that I'm new to both games! and scala.
source share