apparent_encoding

This commit is contained in:
Kenneth Reitz
2012-12-17 06:35:10 -05:00
parent 4c3b9df609
commit bc34f33955
+5
View File
@@ -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