amplify-js
amplify-js copied to clipboard
Accept "body" on delete API
Is this related to a new or existing framework?
React
Is this related to a new or existing API?
REST API
Is this related to another service?
No response
Describe the feature you'd like to request
Using the API, del function more accurately, I would like to be able to send the body on a DELETE request. Currently this is prohibited ( line 6 )
Describe the solution you'd like
I would like the DeleteInput type to match any other type like GetInput, PostInput etc
Describe alternatives you've considered
Tried to create a separate type definitions file, to overwrite current definitions from the library but without luck.
Additional context
No response
Is this something that you'd be interested in working on?
- [ ] 👋 I may be able to implement this feature request
- [ ] ⚠️ This feature might incur a breaking change
Hello, @dorin-moldoveanu-assist and thank you for creating this issue. It seems you're correct that the DeleteInput
type is not consistent with GetInput
and PostInput
types for example, and doesn't allow for any body to be included.
I'll review this feature request with the team internally, but maybe you can provide some additional context. Can you describe in a little more detail the use case and need for the body to be included for this? Is it due to a requirement for an API you're using/built?
Hey @cwomack, sure thing.
Going to give a little bit of context/example for a better understanding. I have a /users endpoint and based on REST best practices, when you wish to delete one user, you will send a DELETE request to /users/{userId} ( no body necessary ). On the same note, if you wish to delete all users, you will send a DELETE request to /users ( no body necessary ). In my case, I would like to delete a specific number of users, hence I would like to send a DELETE request to /users and inside it's body a list of user ids.
Hope the provided information is helpful and a nice reason to accept the body on delete requests. Thanks!
We also encountered the same business requirements, we hope that DELETE can pass parameters through the body
Hello everyone. I too think that the DELETE method should be able to have a BODY.
According to MDN, the DELETE method can have a BODY. https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods/DELETE
Hi all, I too share the same opinion, as It would be nice to have this feature on the project I am currently working on.
It also can have response body, which also isn't currently possible for DELETE API
I would like to use a body on the del method as well. What is the status of this issue?