File tree Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -592,15 +592,17 @@ Here is an example session that uses the ``HEAD`` method. Note that the
592
592
Here is an example session that shows how to ``POST `` requests::
593
593
594
594
>>> import http.client, urllib.parse
595
- >>> params = urllib.parse.urlencode({'spam ': 1 , 'eggs ': 2 , 'bacon ': 0 })
595
+ >>> params = urllib.parse.urlencode({'@number ': 12524 , '@type ': 'issue' , '@action ': 'show' })
596
596
>>> headers = {"Content-type": "application/x-www-form-urlencoded",
597
597
... "Accept": "text/plain"}
598
- >>> conn = http.client.HTTPConnection("musi-cal.mojam.com:80 ")
599
- >>> conn.request("POST", "/cgi-bin/query ", params, headers)
598
+ >>> conn = http.client.HTTPConnection("bugs.python.org ")
599
+ >>> conn.request("POST", "", params, headers)
600
600
>>> response = conn.getresponse()
601
601
>>> print(response.status, response.reason)
602
- 200 OK
602
+ 302 Found
603
603
>>> data = response.read()
604
+ >>> data
605
+ b'Redirecting to <a href="http://bugs.python.org/issue12524">http://bugs.python.org/issue12524</a>'
604
606
>>> conn.close()
605
607
606
608
You can’t perform that action at this time.
0 commit comments