Fix regression caused by requests api change