Updated to work with requests-1.0.0 and higher