[英]How to call an endpoint with HttpDelete attribute in ASP.NET Core MVC?
As usual we are using Http.ActionLink or 'a' tag with tag helpers to call an endpoint and they send Post request.像往常一样,我们使用 Http.ActionLink 或带有标签助手的“a”标签来调用端点并发送 Post 请求。 How can I reach the api/models/5 [HttpDelete] by call from the view?
如何通过视图调用到达 api/models/5 [HttpDelete]?
Browsers only support HTTP GET
and HTTP POST
verbs when using HTML.使用 HTML 时,浏览器仅支持
HTTP GET
和HTTP POST
动词。 You can use other verbs ( DELETE
, PUT
etc) from JavaScript however (via fetch
or XmlHttpRequest
).但是,您可以使用 JavaScript 中的其他动词(
DELETE
, PUT
等)(通过fetch
或XmlHttpRequest
)。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.