I am trying to upload a file to POST API request. I am able to give the file as input to the request if it is my local system path, but when I productionize this, the file should be taken from GCS bucket. Any inputs on this? Below is the code used for my local system file upload:
import requests
url = "API host url"
payload = {'type': 'application/x-zip-compressed'}
files=[
('config-file',('MoveData.zip',open('/C:/Users/xyz/Downloads/MoveData.zip,'rb'),'application/zip'))
]
headers = {
'accept': 'application/json',
'accessKey': 'accessKeyxxxxxxxx',
'secretKey': 'secretkeyxxxxxxxx',
'Content-Type': 'multipart/form-data'
}
response = requests.request("POST", url, headers=headers, data=payload, files=files)
print(response.text)
This works if it is local file but looking for input on how to give GCS file