I am trying to download an export from an app automatically with python. Here is my code:
export_url = 'https://....'
payload = {'key1': 'value1', 'key2': 'value2', 'key3': 'value3'}
r = requests.post(export_url, data=payload)
print(r)
the response is 200 but the file is missing somehow what is wrong?
edit:
this is my whole code:
import requests
URL = 'homepage_after_login'
LOGIN_URL = 'loginpage'
session = requests.session()
username = 'uname'
password = 'pass'
loginformtype = "value"
submit = "Sign+in"
login_data = {'username' : username,
'password' : password,
'login-form-type' : loginformtype,
'submit' : submit}
session.post(LOGIN_URL, data=login_data)
req = session.get(URL)
export_url = 'https://....'
payload = {'key1': 'value1', 'key2': 'value2', 'key3': 'value3'}
r = requests.post(export_url, data=payload)
print(r)
possibily it ignores the login part?