This article mainly introduces Python's method of using post to submit data to a remote URL, involving Python's techniques for using post to deliver data, and the friends you need can refer to the
This example describes how Python uses post to submit data to a remote URL. Share to everyone for your reference. Specifically as follows:
|1 2 3 4 5 6 7 8 9 10 11||Import sys, URLLIB2, urllib zipcode = "s2s 1r8" url = ' http://www.yoursiteweb.com/getForecast ' data = Urllib.urlencode ([(' Query ', zipcode)] req = Urllib2. Request (URL) fd = Urllib2.urlopen (req, data) while 1:data = Fd.read (1024) If isn't Len (data): Break Sys.stdout.write (data)|
I hope this article will help you with your Python programming.