May 2015
Intermediate to advanced
274 pages
5h 11m
English
Many applications use additional parameters along with RESTful HTTP GET requests to obtain required information. Play supports configuring these request parameters as well.
Supposing we have a request to search users by their name, we could define this as follows:
GET /api/search/user controllers.UserController.search(name)
Therefore, we wouldn't need to get the parameters from the request in the action. We could let Play handle acquiring the parameters from the request and passing them to the action.
What do we do when the request parameters are optional? For example, what happens if we allow a search of users by their name where lastName is optional.
We can specify Option as the type for this request parameter. Therefore, ...
Read now
Unlock full access