File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree 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
592592Here is an example session that shows how to ``POST `` requests::
593593
594594 >>> 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' })
596596 >>> headers = {"Content-type": "application/x-www-form-urlencoded",
597597 ... "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)
600600 >>> response = conn.getresponse()
601601 >>> print(response.status, response.reason)
602- 200 OK
602+ 302 Found
603603 >>> data = response.read()
604+ >>> data
605+ b'Redirecting to <a href="http://bugs.python.org/issue12524">http://bugs.python.org/issue12524</a>'
604606 >>> conn.close()
605607
606608
You can’t perform that action at this time.
0 commit comments