Add possibility to specify the request handler to use per query. (re #9704)