import requests
r=requests.head(urla,stream=True) #aa=requests.post(url,headers=head1,json=json2) urlx=r.headers['Location']