From: Mike Waldner Date: Wed, 24 Aug 2011 03:08:26 +0000 (-0400) Subject: Adding check when _enc_data in None X-Git-Tag: v0.8.0~94^2~112^2~12^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=0bf60c8876cddb5b203c652834ab8c6da55e4ce5;p=services%2Fpython-requests.git Adding check when _enc_data in None --- diff --git a/requests/models.py b/requests/models.py index 3cd8def..fc828e1 100644 --- a/requests/models.py +++ b/requests/models.py @@ -391,6 +391,7 @@ class Request(object): #TODO - Auth with User names and accounts #TODO - Files #TODO - OAuth + #TODO - Cookies? #: -L/--location - if there is a redirect, redo request on the new place curl_cmd = 'curl -L ' @@ -410,12 +411,9 @@ class Request(object): data = '' if self.method in ('PUT', 'POST', 'PATCH'): #: -d/--data - send specified data in post request. - #: '-d name=John -d last=Doe' generates the - #: post chunk 'name=John&last=Doe' - if isinstance(self.data, (list, tuple)): data = data.join(['-d ' + key + '=' + value + ' ' for key, value in self.data]) - else: + elif self._enc_data is not None: data = '-d ' + self._enc_data + ' ' #: Params handled in _build_url