Skip to content

Commit

Permalink
Proper requests parameters for multipart/form-data posting
Browse files Browse the repository at this point in the history
Signed-off-by: SystemsPurge <[email protected]>
  • Loading branch information
SystemsPurge committed Nov 14, 2024
1 parent af6fa9c commit 5bce128
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion villas/controller/components/simulator.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ def _upload(self, filename):
params["headers"] = {"Authorization":f"Bearer {self.t_up_token}"}
self.t_up_token = None
with open(filename, 'rb') as f:
params["data"] = f
params["files"] = {'upload_file':f}
r = requests.post(**params)
r.raise_for_status()
self.logger.info(f'Uploaded file {filename} to {url}')
Expand Down

0 comments on commit 5bce128

Please sign in to comment.