How to parse the parameters passed to a custom URL in a WP site


In my WP site-- eg. a request has to be passed to a custom URL--

Now, I wish to obtain the parameters passed to that URL from a function in functions.php of that theme. How do I do this? For above eg I wish to obtain first parameter=abc and second parameter=def-- I already know that the parameters are named param1 and param2.

Yours sincerely,