I'm using play! framework with scala and trying to create a proxy for http requests, GET and POST.
The GET actions seems to be working, the issue is with the POST action, where I'm not able to pass the payload of the request.
I tried several things, like the code below, but none seems to be working.
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"))
}
Last thing to mention is that I'm new to both play! and scala.