Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(46)

Unified Diff: Doc/library/http.client.rst

Issue 10639: reindent.py converts newlines to platform default
Patch Set: Created 8 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Doc/library/html.entities.rst ('k') | Doc/library/http.cookies.rst » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
--- a/Doc/library/http.client.rst Tue Jul 26 09:37:46 2011 +0300
+++ b/Doc/library/http.client.rst Mon Jul 25 09:47:18 2011 -0400
@@ -592,17 +592,15 @@
Here is an example session that shows how to ``POST`` requests::
>>> import http.client, urllib.parse
- >>> params = urllib.parse.urlencode({'@number': 12524, '@type': 'issue', '@action': 'show'})
+ >>> params = urllib.parse.urlencode({'spam': 1, 'eggs': 2, 'bacon': 0})
>>> headers = {"Content-type": "application/x-www-form-urlencoded",
... "Accept": "text/plain"}
- >>> conn = http.client.HTTPConnection("bugs.python.org")
- >>> conn.request("POST", "", params, headers)
+ >>> conn = http.client.HTTPConnection("musi-cal.mojam.com:80")
+ >>> conn.request("POST", "/cgi-bin/query", params, headers)
>>> response = conn.getresponse()
>>> print(response.status, response.reason)
- 302 Found
+ 200 OK
>>> data = response.read()
- >>> data
- b'Redirecting to <a href="http://bugs.python.org/issue12524">http://bugs.python.org/issue12524</a>'
>>> conn.close()
« no previous file with comments | « Doc/library/html.entities.rst ('k') | Doc/library/http.cookies.rst » ('j') | no next file with comments »

RSS Feeds Recent Issues | This issue
This is Rietveld 894c83f36cb7+