【问题标题】:Can I call any method in XmlHttpRequest not only GET, POST, PUT我可以在 XmlHttpRequest 中调用任何方法,而不仅仅是 GET、POST、PUT
【发布时间】:2017-04-23 19:42:17
【问题描述】:

我可以在 XmlHttpRequest 中调用任何方法,不仅是 GET、POST、PUT 吗?

*更多信息:*

我的控制器名为 equal = AccountsController

在控制器中,我有一个名为等于Connnect(Account acc)的方法

我想从那个控制器调用这个方法如何?

例如:

var xhr = new XmlHttpRequest();
xhr.open("CONNECT", "www.any.link/api/Accounts", true);

【问题讨论】:

  • 那么当你尝试它时发生了什么?
  • @epascarello 我可以调用任何方法,不仅是 GET、POST、PUT 吗?
  • @epascarello 我会测试,但你能回答我的问题吗?

标签: javascript asp.net asp.net-mvc xmlhttprequest asp.net-apicontroller


【解决方案1】:

您也可以使用HEADDELETEOPTIONSCONNECT

有关更多信息,您可以访问此页面:

http://www.w3schools.com/tags/ref_httpmethods.asp

也许你觉得这篇文章有用:

Are the PUT, DELETE, HEAD, etc methods available in most web browsers?

【讨论】:

  • 我可以使用其他的吗?例如我可以在某些控制器中使用我创建的 ISONLINE 方法吗??
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2018-12-19
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多