Reputation: 2502
Hi have the following routes
file:
POST /user/:id controllers.Application.updateUser(id: Long)
Is there an easy way to get the value from the Http.Context
? The context.request().queryString()
is always empty.
Upvotes: 0
Views: 1915
Reputation: 1
context.request()._underlyingRequest().getQueryString(<ID>)
Upvotes: 0
Reputation: 12850
context.request().queryString()
only returns query string parameters, whereas you're putting the id
in the path. If you want to get it, you have to extract it out of path yourself, eg:
long id = Long.parseLong(context.request().uri().substring(
context.request().uri().lastIndexOf('/') + 1));
Upvotes: 3