guys! I’m currently working with an API that uses the following cURL line:
curl -vF "files[]=@file.zip" "http://s5.example.com/123"
I’m not interested in using other libraries such as pycurl, because I really only need to convert a line or two. I really appreciate your help!
All you need is urlopen method of urllib module.. .
Syntax:
urllib2.urlopen(url[, data][, timeout])
data is the string specifying additional stuff to send to the server
Example:
this example shows a single line code to extract all tlds into a a list called tlds by crawling it from iana.org
For complex operations/options/parameters of urlopen method you can check the official documentation: http://docs.python.org/library/urllib2.html