So I’m trying to check if my code works by showing any data from my inpute datas for a result. In this case I want to show the image_content as a string to check if my code works. I’m new to python and zapier I’m just winging it at the moment.
DATA:
![](https://uploads-us-west-2.insided.com/zapier-ca/attachment/08596092-0df9-4b4a-8605-7d27d3787861.png)
CODE:
import requests
def upload_image(upload_url, upload_headers, image_content):
try:
response = requests.put(
upload_url,
headers=upload_headers,
data=image_content,
timeout=60 # Adjust timeout as needed
)
response.raise_for_status() # Raise an exception for HTTP errors
#print("Image uploaded successfully.")
return {'data': input_data['image_content']}
except requests.exceptions.RequestException as e:
print(f"Error uploading image: {e}")
return {'data': input_data['image_content']}
# Example usage:
if __name__ == "__main__":
# Replace with actual values from Remini.ai response
upload_url = input_data['upload_url']
upload_headers = {
'Content-Type': input_data['upload_headers_Content_Tpye'],
'x-goog-custom-time': input_data['upload_headers_X_Goog_Custom_Time'],
'Content-MD5': input_data['upload_headers_Content_MD_5']
}
image_content = input_data['image_content'] # Replace with actual image binary data
upload_image(upload_url, upload_headers, image_content)
But when I test the code it shows this as a result
![](https://uploads-us-west-2.insided.com/zapier-ca/attachment/b7d50342-cfa3-452d-8146-47448a14f3bb.png)
I really need your help on this.
-Gab