Hi All,
I’ve been trying to upload a file using the /api/management/v1/deployments/artifacts/generate endpoint, however it returns the following error:
{'error': 'no multipart boundary param in Content-Type', 'request_id': 'd915bbaf-78bc-4a08-a9de-a7752a3f4309'}
when running the following python code using requests and I’m not sure what could be causing it. Any suggestions or ideas would be appreciated. Thanks
self.post_headers = {
'Content-Type': 'multipart/form-data',
'Accept': 'application/json',
'Authorization': self.authorization
}
with open("/home/user/workspace/deploy/deploy/demo.txt", "rb") as f:
deb_file = f.read()
print(deb_file)
payload = {
'name': "test",
'description': "test",
'device_types_compatible': ["test"],
'type': "single_file",
'args': "string",
'file': deb_file
}
r = requests.post('https://hosted.mender.io/api/management/v1/deployments/artifacts/generate',
data=payload, headers=self.post_headers)