We would like to upload a string with python. I found here some examples and created the following script.
import requests
url = 'https://URL/fileupload?FileName=file.csv'
headers = {'content-type': 'octet-stream'}
files = {'file': ('ID,Name\n1,test')}
r = requests.post(url, files=files, headers=headers, auth=('user', 'password'))
The upload is working but the output contains some unexpected lines.
--ec7b507f800f48ab85b7b36ef40cfc44
Content-Disposition: form-data; name="file"; filename="file"
ID,Name
1,test
--ec7b507f800f48ab85b7b36ef40cfc44--
The goal is to only upload the following from files = {'file': ('ID,Name\n1,test')}
:
ID,Name
1,test
How is this possible?