(#12399) DRY up rest.rb
Move the calls to request.do_request(...) to a method to encapsulate the params