Explorar o código

[rest] Slight clean-up in HttpClient

Romain Rigaux %!s(int64=4) %!d(string=hai) anos
pai
achega
d2342a6637
Modificáronse 1 ficheiros con 3 adicións e 3 borrados
  1. 3 3
      desktop/core/src/desktop/lib/rest/http_client.py

+ 3 - 3
desktop/core/src/desktop/lib/rest/http_client.py

@@ -192,10 +192,11 @@ class HttpClient(object):
 
     @return: The result of urllib2.urlopen()
     """
-    # Prepare URL and params
     if urlencode:
       path = urllib_quote(smart_str(path))
+
     url = self._make_url(path, params)
+
     if http_method in ("GET", "DELETE"):
       if data is not None:
         self.logger.warn("GET and DELETE methods do not pass any data. Path '%s'" % path)
@@ -226,8 +227,7 @@ class HttpClient(object):
       if resp.status_code >= 300:
         resp.raise_for_status()
         raise exceptions.HTTPError(response=resp)
-      # Cache request cookie for the next http_client call.
-      self._cookies = resp.cookies
+      self._cookies = resp.cookies  # Cache request cookie for the next http_client call.
       return resp
     except (exceptions.ConnectionError,
             exceptions.HTTPError,