projects
/
services
/
python-requests.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
4c3b9df
)
apparent_encoding
author
Kenneth Reitz
<me@kennethreitz.com>
Mon, 17 Dec 2012 11:35:10 +0000
(06:35 -0500)
committer
Kenneth Reitz
<me@kennethreitz.com>
Mon, 17 Dec 2012 11:35:10 +0000
(06:35 -0500)
requests/models.py
patch
|
blob
|
history
diff --git
a/requests/models.py
b/requests/models.py
index
308abb3
..
92f2baf
100644
(file)
--- a/
requests/models.py
+++ b/
requests/models.py
@@
-418,6
+418,11
@@
class Response(object):
return False
return True
+ @property
+ def apparent_encoding(self):
+ """The apparent encoding, provided by the lovely Charade library."""
+ return chardet.detect(self.content)['encoding']
+
def iter_content(self, chunk_size=1, decode_unicode=False):
"""Iterates over the response data. This avoids reading the content
at once into memory for large responses. The chunk size is the number