From 8b750ee18222bc20528c724bf3eb05bc5831d9f7 Mon Sep 17 00:00:00 2001 From: Danilo Bargen Date: Tue, 21 Feb 2012 09:24:52 +0100 Subject: [PATCH] Added StringIO/Image example to quickstart documentation. --- docs/user/quickstart.rst | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/docs/user/quickstart.rst b/docs/user/quickstart.rst index d2709d20..3202ee67 100644 --- 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 --------------------