views:

74

answers:

2

How to make multiple HTTP POST queries in one moment using Python?

Using an external library with an example can be a good solution.

+1  A: 

External lib? Maybe an internal one would do the trick...

http://docs.python.org/library/httplib.html#examples

specifically:

params = urllib.urlencode({'spam': 1, 'eggs': 2, 'bacon': 0})

If you wanted to process multiple HTTP POST queries (asynchronous) you could cycle through them in a loop, opening subprocesses using subprocess.Popen. Although a better solution would probably be asyncore. This site has an example of using asyncore for http requests (like POST).

Sleepingrock
No. It's synchronous request. While it process, app need to wait for continue next request
Setti
So you want asynchronous POST requests in Python?
Paul D. Waite
Added those as well.
Sleepingrock
Yes, asynchronous POST requests
Setti
A: 

You should consider using threading (or maybe multiprocessing, but here the GIL is not a problem) to enable concurrent execution.

badp
Asyncore is primarily threading for sockets. It would be easier to implement in this case.
Sleepingrock