I want to upload a file to S3 with the put_object method of Boto3, I want to receive the file via an http request with the binary body of the file.
<code> @app.post("/ref-arch/documents/<path>")
@tracer.capture_method
def documents(path:str) -> bool:
data = app.current_event.body or "None"
file_bin = data.encode()
result = asyncio.run(
document_service.putObjectToS3Bytes(path=f"pruebas/documentos/{path}",data=file_bin)
)
return result
</code>
<code> @app.post("/ref-arch/documents/<path>")
@tracer.capture_method
def documents(path:str) -> bool:
data = app.current_event.body or "None"
file_bin = data.encode()
result = asyncio.run(
document_service.putObjectToS3Bytes(path=f"pruebas/documentos/{path}",data=file_bin)
)
return result
</code>
@app.post("/ref-arch/documents/<path>")
@tracer.capture_method
def documents(path:str) -> bool:
data = app.current_event.body or "None"
file_bin = data.encode()
result = asyncio.run(
document_service.putObjectToS3Bytes(path=f"pruebas/documentos/{path}",data=file_bin)
)
return result
When receiving it in lambda and accessing the body it is in string format, is there any way to access this information in a binary way?