Use httplib to replace urllib2