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:
793d314
)
Added StringIO/Image example to quickstart documentation.
author
Danilo Bargen
<gezuru@gmail.com>
Tue, 21 Feb 2012 08:24:52 +0000
(09:24 +0100)
committer
Danilo Bargen
<gezuru@gmail.com>
Tue, 21 Feb 2012 08:24:52 +0000
(09:24 +0100)
docs/user/quickstart.rst
patch
|
blob
|
history
diff --git
a/docs/user/quickstart.rst
b/docs/user/quickstart.rst
index
d2709d2
..
3202ee6
100644
(file)
--- a/
docs/user/quickstart.rst
+++ b/
docs/user/quickstart.rst
@@
-59,6
+59,13
@@
You can also access the response body as bytes, for non-text requests::
The ``gzip`` and ``deflate`` transfer-encodings are automatically decoded for you.
+For example to create an image from binary data returned by a request, you can
+use the following code:
+
+ >>> from PIL import Image
+ >>> from StringIO import StringIO
+ >>> i = Image.open(StringIO(r.content))
+
Raw Response Content
--------------------