From: Kenneth Reitz Date: Mon, 16 May 2011 00:25:01 +0000 (-0400) Subject: example udpate X-Git-Tag: v0.4.1^2~48 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=70857f30971590208f42ecf4d80ce80389b0a66b;p=services%2Fpython-requests.git example udpate --- diff --git a/docs/index.rst b/docs/index.rst index dc8c321..b47c335 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -17,17 +17,15 @@ It reqires an *enormous* amount of work (even method overrides) to perform the s Things shouldn’t be this way. Not in Python. -It's Simple ------------ - :: - >>> import requests - >>> r = requests.get('https://convore.com/api', auth=('username', 'password')) - >>> r.headers['content-encoding'] - json + >>> r = requests.get('https://api.github.com', auth=('user', 'pass')) + >>> r.status_code + 200 + >>> r.headers['content-type'] + 'application/json' -See `the same code, without Requests `_. +See `the same code, without Requests `_. Requests allow you to send **GET**, **HEAD**, **PUT**, **POST**, and **DELETE** HTTP requests. You can add headers, form data,