I need to download a file from an external source, I am using Basic authentication to login to the URL
import requests response = requests.get('<external url', auth=('<username>', '<password>')) data = response.json() html = data['list'][0]['attachments'][0]['url'] print (html) data = requests.get('<API URL to download the attachment>', auth=('<username>', '<password>'), stream=True) print (data.content) I am getting below output
<url to download the binary data> \x00\x00\x13\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x0f\xcb\x00\x00\x1e\x00\x1e\x00\xbe\x07\x00\x00.\xcf\x05\x00\x00\x00' I am expecting the URL to download the word document within the same session.
authin the second request as well?.contentattribute.