How can I save XML API response to an .xml files? Or cache it, that way I can parse it before parsing the response.
import requests
r = requests.get('url', auth=('user', 'pass'))
I looked at a similar question for JSON: https://stackoverflow.com/a/17519020/4821590
import requests
import json
solditems = requests.get('https://github.com/timeline.json') # (your url)
data = solditems.json()
with open('data.json', 'w') as f:
json.dump(data, f)
file.open('foo.xml').write(r.text)