Ajax from Python, without using libraries - how do I do it?
How would I update something at http://localhost/update.php?text=Hello world
?
This question is helpful, but what about the Ajax parameters to the URL?
Ajax from Python, without using libraries - how do I do it?
How would I update something at http://localhost/update.php?text=Hello world
?
This question is helpful, but what about the Ajax parameters to the URL?
From @unwind's answer to this question:
use urllib.
From the examples in the documentation:
>>> import urllib >>> params = urllib.urlencode({'spam': 1, 'eggs': 2, 'bacon': 0}) >>> f = urllib.urlopen("http://www.musi-cal.com/cgi-bin/query?%s" % params) >>> print f.geturl() # Prints the final URL with parameters. >>> print f.read() # Prints the contents