HTML 表单的模式无法为 REST 生成 DELETE
嗨,我知道这有点疯狂,但现在我的项目有点疯狂。我们有一个 RESTful 应用程序,它可以提供很多服务,我们都知道 DELETE 是一个动词,用于删除东西。然而,我们也知道 HTML 表单不能产生 DELETE,我说得对吗?我们如何解决这个问题?和建议将不胜感激。
谢谢,
Hi I know this is a bit wired, but right now my project has gone a bit mad. We have a RESTful application which can provide a bunch of services, we all know that DELETE is a verb to use to delete stuff. However, as we also know that HTML form cannot produce DELETE am I right? How do we solve this issue? And suggestion would be greatly appreciated.
Thanks,
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
为此,您需要使用 javascript。这是一个示例:
然后您可以从网页按钮的 onclick="" 调用 sendDelete() 方法。
You need to use javascript for that. Here is an example:
Then you can just call the sendDelete() method from the onclick="" of your web page button.