A normal urllib2
works fine:
>>> import urllib2
>>> r = urllib2.urlopen(u"http://bit.ly/4ovTZw")
>>> r.geturl()
'http://www.writing.com/main/handler/action/show_document/item_id/933413.mp3'
>>> r.headers.get("Content-Type")
'audio/mpeg'
But in appengine, the same code shows text/html
.
def get(self):
r = urllib2.urlopen(u"http://bit.ly/4ovTZw")
self.response.out.write( r.geturl() )
self.response.out.write( r.headers.get("Content-Type") )
return
Can I get around this? Why is this happening?