Bharadwaj <barbi.br...@gmail.com> added the comment:

Newbie here. Please be patient.

When I tried using the POST form in this page, I ran into minor issues.
1. The form returns a 302 to the actual issue page. Some other example with 200 
may be better.
2. The params are a little weird, with '@' in the names. Might be confusing for 
newbies.
3. Form action param is '#', which is not a great example.

Please suggest if I should continue with this example or find a better one.

Code:
import http.client, urllib.parse
params = urllib.parse.urlencode({'@number': 12524, '@type': 'issue', '@action': 
'show'})
headers = {"Content-type": "application/x-www-form-urlencoded",
           "Accept": "text/plain"}
conn = http.client.HTTPConnection("bugs.python.org")
conn.request("POST", "#", params, headers)
response = conn.getresponse()
print(response.status, response.reason)
data = response.read()
conn.close()
data
b'Redirecting to <a 
href="http://bugs.python.org/issue12524";>http://bugs.python.org/issue12524</a>'

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue12524>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to