Play 2.0 framework - POST parameters

后端 未结 3 971
粉色の甜心
粉色の甜心 2021-01-18 15:09

I\'m trying to POST parameters to Action, and wrote in the routes:

# Home page
GET    /                         controllers.Application.index()

POST   /logi         


        
3条回答
  •  长发绾君心
    2021-01-18 15:31

    Though an old post, but if anyone new comes to the question. We should not add parameters, when you are using post, also if you did use parameters, it would be GET /login/:name/:password controllers.Application.login(name: String, password: String)

    For post, don't add parameters and bind it to a case class inside the controllers and access the variables.

提交回复
热议问题