Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

Update the advanced doc to use the r.json method #1085

Merged
merged 1 commit into from Jan 7, 2013

Conversation

Projects
None yet
5 participants
Contributor

graingert commented Jan 4, 2013

No description provided.

Owner

Lukasa commented Jan 5, 2013

Awesome. I'm +1 on this. The broken tests aren't your fault. =D

Owner

sigmavirus24 commented Jan 5, 2013

+1 as well

@sprt sprt commented on the diff Jan 6, 2013

docs/user/advanced.rst
@@ -313,17 +313,12 @@ out what type of content it is. Do this like so::
...
application/json; charset=utf-8
-So, GitHub returns JSON. That's great, we can use the JSON module to turn it
-into Python objects. Because GitHub returned UTF-8, we should use the
-``r.text`` method, not the ``r.content`` method. ``r.content`` returns a
-bytestring, while ``r.text`` returns a Unicode-encoded string. I have no plans
-to perform byte-manipulation on this response, so I want any Unicode code
-points encoded.
+So, GitHub returns JSON. That's great, we can use the ``r.json`` method to
@sprt

sprt Jan 6, 2013

Contributor

Typo: r.json should be r.json()

@graingert

graingert Jan 6, 2013

Contributor

Whoops, I was using the terminology "we should use the > -r.text
method, not the r.content method. r.content" which should have been
attribute anyway
On Jan 6, 2013 4:24 AM, "sprt" notifications@github.com wrote:

In docs/user/advanced.rst:

@@ -313,17 +313,12 @@ out what type of content it is. Do this like so::
...
application/json; charset=utf-8

-So, GitHub returns JSON. That's great, we can use the JSON module to turn it
-into Python objects. Because GitHub returned UTF-8, we should use the
-r.text method, not the r.content method. r.content returns a
-bytestring, while r.text returns a Unicode-encoded string. I have no plans
-to perform byte-manipulation on this response, so I want any Unicode code
-points encoded.
+So, GitHub returns JSON. That's great, we can use the r.json method to

Typo: r.json should be r.json()


Reply to this email directly or view it on GitHubhttps://github.com/kennethreitz/requests/pull/1085/files#r2559427.

@graingert

graingert Jan 7, 2013

Contributor

Actually r.json is the method. r.json() is an invocation.

It seems that throughout the documentation the invocation and the method are used interchangeably.

Owner

sigmavirus24 commented Jan 6, 2013

Heh, good catch. Would have been good if @Lukasa or I had actually looked at the PR. ;)

Owner

kennethreitz commented Jan 7, 2013

Thanks!

@kennethreitz kennethreitz added a commit that referenced this pull request Jan 7, 2013

@kennethreitz kennethreitz Merge pull request #1085 from graingert/patch-1
Update the advanced doc to use the r.json method
47fe258

@kennethreitz kennethreitz merged commit 47fe258 into requests:master Jan 7, 2013

1 check failed

default The Travis build failed
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment