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:
d5572ac
)
iter_json
author
Kenneth Reitz
<me@kennethreitz.com>
Mon, 17 Dec 2012 07:42:34 +0000
(
02:42
-0500)
committer
Kenneth Reitz
<me@kennethreitz.com>
Mon, 17 Dec 2012 07:42:34 +0000
(
02:42
-0500)
Closed #1015
requests/models.py
patch
|
blob
|
history
diff --git
a/requests/models.py
b/requests/models.py
index
ab91c1c
..
7fe40a5
100644
(file)
--- a/
requests/models.py
+++ b/
requests/models.py
@@
-542,6
+542,11
@@
class Response(object):
except ValueError:
return None
+ def iter_json(self):
+ for line in self.iter_lines():
+ if line: # filter out keep-alive new lines
+ yield json.loads(line)
+
@property
def links(self):
"""Returns the parsed header links of the response, if any."""