The code below is to download the package and upload the package without saving it to a file. Download the package into memory seems working, but uploading is not working. Can someone help me with it? Also, I may also want to download the package onto a local file and upload it through Python code later.
Error code: 400; Reason: Bad Request; {āErrorMessageā: āThere was a problem with your request.ā, āErrorsā: [āA package file must be providedā], āParsedHelpLinksā: []}
Traceback (most recent call last):
File āD:/Docs/code/github/octopus-python-client/src/octopus_python_client/utilities/send_requests_to_octopus.pyā, line 65, in call_octopus
err=f"Error code: {session_response.status_code}; Reason: "
File āD:\Docs\code\github\octopus-python-client\src\octopus_python_client\utilities\helper.pyā, line 194, in log_raise_value_error
raise ValueError(err)
ValueError: Error code: 400; Reason: Bad Request; {āErrorMessageā: āThere was a problem with your request.ā, āErrorsā: [āA package file must be providedā], āParsedHelpLinksā: []}
Hey there Tony! Thank you for bearing with me, I needed to wait until one of the engineers was available and theyāre all Australia based. One of the engineers was able to provide the following
The code your provided works! I also found out why my code did not work. My headers had {āContent-Typeā: āapplication/jsonā}. After removing it, my code also works without saving the file locally.