Could we rather have a utility function that builds URIs with a signature similar to what's below?

    buildUri(root, paths, queryParams);
    buildUri(root, [ 'upload', 'some/complex/path' ], { prettyPrint: true })

It will unify the URI generation which looks quite sparsely handled at the moment.