curl = pycurl.Curl()
curl.setopt(curl.URL, 'https://www.yoursite.com/')
curl.setopt(curl.USERPWD, '%s:%s' % ('youruser', 'yourpassword'))
curl.setopt(curl.WRITEFUNCTION, response_buffer.write)
curl.perform()
curl.close()
response_value = response_buffer.getvalue()
python http request with token