mirror of
https://github.com/kennethreitz/requests.git
synced 2026-06-05 22:50:18 +00:00
Merge pull request #447 from gwrtheyrn/patch-1
Added StringIO/Image example to quickstart documentation.
This commit is contained in:
@@ -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
|
||||
--------------------
|
||||
|
||||
Reference in New Issue
Block a user