Do to download a file and set its content type using Java, using python I do it this way:
import urllib2
req = urllib2.Request('http://www.example.com/', data="abc", headers={'Content-type': 'text/plain'})
r = urllib2.urlopen(req)
My questions are:
What's this Python code equivalence for Java ?
Also, is it possible to make an asynchronous download with a callback when the download is completed ?