gerrit_util: Use httplib2 for communication instead of httplib.
Retain the httplib import to continue using its constants, but actually make the http(s) connections using httplib2. The latter has built-in support for proxy settings, which then actually allows people behind proxies to interact with Gerrit. Compared to httplib, the biggest changes are: - There's only one Http class instead of HTTPConnection and HTTPSConnection. - Http.request() returns a tuple (response, contents). - Http.request() expects a full URI instead of just a path, as Http's constructor does not take a host parameter. - The response object inherits from dict. - All headers in a response are lower-cased. All in all, it is possible to see that httplib2 support was retro-fitted into the code, but that should not worsen its readability overall. Patch written in collaboration with Alexis Menard <alexis.menard@intel.com>. BUG=672729 R=alexis.menard@intel.com,agable@chromium.org,tandrii@chromium.org Change-Id: Ic40e804064e74e89bc2ad979572628f1bd78c19a Reviewed-on: https://chromium-review.googlesource.com/458221Reviewed-by: Aaron Gable <agable@chromium.org> Commit-Queue: Raphael Kubo da Costa (rakuco) <raphael.kubo.da.costa@intel.com>
Showing
Please
register
or
sign in
to comment