Skip to content
Myr

works for block and non-block connections

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

authored by Kenneth Reitz · committed by Kenneth Reitz · parent 5287b8c · Browse files · 2 files+10 added−7 removed
This commit

State

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

Diff stats

2 files+10 added−7 removed

  • other:+10 added−7 removed

2 files+10 added−7 removed

modified:requests/models.py+4 added-4 removed
330 unmodified lines
331 headers=self.headers,332 redirect=False,333 assert_same_host=False,334 # preload_content=True335 preload_content=False336 # block=do_block335 # preload_content=False336 preload_content=do_block337 )338339 # Extract cookies.340 # if self.cookiejar is not None:
124 unmodified lines
465 # print466 # print467 # print468469 # self.raw.read() or470 self._content = self.raw.read()469 # self.raw.read() or470 self._content = self.raw.read() or self.raw.data471 # print self.raw.__dict__472473 # Decode GZip'd content.474 if 'gzip' in self.headers.get('content-encoding', ''):
62 unmodified lines
modified:requests/utils.py+6 added-3 removed
13 unmodified lines
14import cookielib15import re16import urllib17import zlib18from urlparse import urlparse, urlunparse, urljoin18from urlparse import urlparse, urlunparse192021def encode_params(params):22 """Encode parameters in a piece of data.
9 unmodified lines
32 if hasattr(params, 'items'):33 result = []34 for k, vs in params.items():35 for v in isinstance(vs, list) and vs or [vs]:36 result.append(37 (36 result.append((k.encode('utf-8') if isinstance(k, unicode) else k,37 v.encode('utf-8') if isinstance(v, unicode) else v)38 k.encode('utf-8') if isinstance(k, unicode) else k,39 v.encode('utf-8') if isinstance(v, unicode) else v40 )41 )42 return urllib.urlencode(result, doseq=True)4344 else:
338 unmodified lines