Skip to content
Myr

Refactor Request#__init__

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Johannes Gorset · committed by Johannes Gorset · parent 637d033 · Browse files · 1 file+2 added−6 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+2 added−6 removed

  • other:+2 added−6 removed

1 file+2 added−6 removed

modified:requests/models.py+2 added-6 removed
45 unmodified lines
46 self.data = dict()47 #: True if :class:`Request <models.Request>` is part of a redirect chain (disables history48 #: and HTTPError storage).49 self.redirect = redirect5051 # self.data = {}50 51 if hasattr(data, 'items'):52 for (k, v) in data.items():53 self.data.update({54 k.encode('utf-8') if isinstance(k, unicode) else k:55 v.encode('utf-8') if isinstance(v, unicode) else v56 })5859 # url encode data if it's a dict60 if hasattr(data, 'items'):57 self._enc_data = urllib.urlencode(self.data)58 else:63 self._enc_data = data59 self._enc_data = self.data = data6061 #: :class:`Response <models.Response>` instance, containing62 #: content and metadata of HTTP Response, once :attr:`sent <send>`.63 self.response = Response()
436 unmodified lines