Skip to content
Myr

Fixup the remaining references to timeline.json.

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Cory Benfield · committed by Cory Benfield · parent 082c8d0 · Browse files · 1 file+3 added−3 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+3 added−3 removed

  • other:+3 added−3 removed

1 file+3 added−3 removed

modified:docs/user/quickstart.rst+3 added-3 removed
79 unmodified lines
80We can read the content of the server's response. Consider the GitHub timeline81again::8283 >>> import requests84 >>> r = requests.get('https://github.com/timeline.json')84 >>> r = requests.get('https://api.github.com/events')85 >>> r.text86 u'[{"repository":{"open_issues":0,"url":"https://github.com/...8788Requests will automatically decode content from the server. Most unicode
44 unmodified lines
133134There's also a builtin JSON decoder, in case you're dealing with JSON data::135136 >>> import requests137 >>> r = requests.get('https://github.com/timeline.json')137 >>> r = requests.get('https://api.github.com/events')138 >>> r.json()139 [{u'repository': {u'open_issues': 0, u'url': 'https://github.com/...140141In case the JSON decoding fails, ``r.json`` raises an exception. For example, if
7 unmodified lines
149In the rare case that you'd like to get the raw socket response from the150server, you can access ``r.raw``. If you want to do this, make sure you set151``stream=True`` in your initial request. Once you do, you can do this::152153 >>> r = requests.get('https://github.com/timeline.json', stream=True)153 >>> r = requests.get('https://api.github.com/events', stream=True)154 >>> r.raw155 <requests.packages.urllib3.response.HTTPResponse object at 0x101194810>156 >>> r.raw.read(10)157 '\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\x03'
291 unmodified lines