The method I will use is DELETE request, and I have this url for web service call:
http://www.localhost:9000/example/com/foo/bar
I want to extract /foo and /bar and store it in a variable.
Does anybody know how to do this? Thanks!
I'm using play2-mini for web service and dispatch for scala for making http request.
Play has a very sophisticated way of passing parameters and that is through Routes definition. In your conf/Routes file define a Route like
when you will enter
in your browser,
deleteAction
defined by your Controller will be invoked and string "user" will be passed to it in its parameterfoo
. there you can manipulate it. Note that part of URI followed by colon is dynamic. It will accept anything that fulfills requirement of being a string and will forward it to deleteAction by storing it infoo
variable.