From ca57e04ead88c5928bb4b5bfadc39778dd8afbbe Mon Sep 17 00:00:00 2001 From: David Pursehouse Date: Fri, 2 May 2014 09:50:02 +0900 Subject: Set HTTP headers to reduce data transfer time Request compact JSON by setting: 'Accept: application/json' Request compressed response by setting: 'Accept-Encoding: gzip' Change-Id: Ie1b5169d43b164f0e06aa765cbf76cca25d629f3 --- pygerrit/rest.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pygerrit/rest.py b/pygerrit/rest.py index cccfa94..9b96178 100644 --- a/pygerrit/rest.py +++ b/pygerrit/rest.py @@ -68,8 +68,11 @@ class GerritRestAPI(object): configured to not attempt to verify SSL certificates. """ + headers = {'Accept': 'application/json', + 'Accept-Encoding': 'gzip'} self.kwargs = {'auth': auth, - 'verify': verify} + 'verify': verify, + 'headers': headers} self.url = url.rstrip('/') self.session = requests.session() -- cgit v1.2.1