scala - Play framework: empty body in post request -


helo! have following code:

def foo = action { request =>     ok(request.body.astext.getorelse("no body")) } 

in frontend have form this:

<form action="@controllers.routes.application.foo()" method="post">     <input name="name" type="text">     <input name="surname" type="text">      <button type="submit"> </form> 

if fill form , click submit, gives me result: no body. if add brakepoint in debugger ok(..), shows me, body not emty.

anycontentasformurlencoded(map(name -> arraybuffer(123), surname -> arraybuffer(123))) 

why, doesn't give me body text, or else, , how can them?

given form , debugging output, should using asformurlencoded.


Comments

Popular posts from this blog

android - Gradle sync Error:Configuration with name 'default' not found -

java - Andrioid studio start fail: Fatal error initializing 'null' -

html - jQuery UI Sortable - Remove placeholder after item is dropped -