Read full request URL in Play Web Framework

415 Views Asked by At

I am trying to read full URL which comes with #params. How can i read in Play controller? I am able to read query parameters but not route directive

ex : https://x.app.com/callback#x=1

Action.async{ implicit request =>
     val fullUrl = ??? //Read full url of request
}

I tried request.uri and request.path. both are not helpful.

response of request.uri => /callback
response of request.path => /callback

There are no #params in the response.

2

There are 2 best solutions below

0
geek94 On

you can use:

request.path 

or

request.uri
2
Tijkijiki On

You cant pass fragment (# part) to server, it is browser only. Use query parameter instead