Closed i-Ching closed 1 year ago
Very poetic.
Its not about delete, delete can return a value. Status code 204 does not support content. You can change the status to 200 or something else and return a value.
Regarding other frameworks - you are welcome to try returning 204 with starlette and content and see what happens. Its simply that starlette and fastAPI default to 200 for delete, which is semantically wrong.
Starlite version 1.44.0 does not allow delete method to return any result. It is impractical for real-life usage.
Starlette and FastApi allows DELETE method to return results: https://sqlmodel.tiangolo.com/tutorial/fastapi/delete/
Aiohttp, Sanic and Quart allow DELETE method to return results too: https://sanic.dev/en/guide/advanced/class-based-views.html#defining-a-view https://subscription.packtpub.com/book/web-development/9781801076302/2/ch02lvl1sec11/how-quart-handles-requests
Because "results of DELETE return" save our extra codes. It make programs simple and direct to match with SQLAlchemy results: Delete support the ability to return the number of rows matched after the statement proceeds https://docs.sqlalchemy.org/en/20/tutorial/data_update.html#tutorial-multi-table-deletes
My main point is: I request DELETE method of Starlite passing the point of some return, as same as other competitors https://youtu.be/D-TgDvyr3g4?t=132