Create a resource with a method with two optional arguments "param-a" and "param-b" as url parameters. Don't set default value for these two parameters.
The callback will look like callback($a, $b). If you access the corresponding url with only the "param-b" parameter then in callback $b is empty but $a holds the value of "param-b".

Workaround : set a default value.