Reputation: 539
urllib fetches data from urls right? is there a python library that can do the reverse of that and send data to urls instead (for example, to a site you are managing)? and if so, is that library compatible with apache?
thanks.
Upvotes: 0
Views: 182
Reputation: 3604
urllib can send data associated with a request by using GET or POST.
urllib2.urlopen(url, data)
where data is a dict of key-values representing the data you're sending. See this link on usage.
Then process that data on the server-side.
If you want to send data any other way, you should use some other protocol such as FTP (see ftplib).
Upvotes: 2
Reputation: 599796
What does sending data to a URL mean? The usual way to do that is just via an HTTP POST, and urllib
(and urllib2
) handle that just fine.
Upvotes: 6