Yes, that shared code is already being used in the Rest class (defined in the http_rest.js file).

In this case the gmail connector defines the specific headers for accessing google.
Other services were not using this, in case we find more services in need for this, we will refactor for reusing.

Thanks for checking :)