PUT requests for storage uploads
lrajca opened this issue · comments
Luke Rajca commented
Is your feature request related to a problem? Please describe.
Not sure if this is already supported somehow already that I've missed. Would be nice to be able to PUT objects to overwrite the contents, currently attempts using upload() returns a
{'statusCode': 400, 'error': 'Duplicate', 'message': 'The resource already exists'}
Describe the solution you'd like
Either we could add a parameter to the existing upload function to define the HTTP Method, or just add a new method.
ie
class HttpMethod(Enum):
PUT = "PUT"
POST = "POST"
def upload(... method: HttpMethod = HttpMethod.POST):
....
return self._request(
method,
f"/object/{_path}",
files=files,
headers=headers,
)
Joel Lee commented
Hey!
Thanks for flagging this - I don't think this exists at the moment. PRs are welcome!