user582485
user582485

Reputation: 539

python library that is the inverse of urllib?

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

Answers (2)

Dan
Dan

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

Daniel Roseman
Daniel Roseman

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

Related Questions