webservice支持httpget及post方法

1.在web.config中节点system.web里面添加

  <webServices>
      <protocols>
        <add name="HttpGet" />
        <add name="HttpPost" />
      </protocols>
    </webServices>

2.在调用方法添加特性

   [WebMethod,ScriptMethod(ResponseFormat = ResponseFormat.Json, UseHttpGet = true)]

参考:https://www.cnblogs.com/FlyStupidBird/p/13431621.html

posted @ 2022-07-13 17:07  乌柒柒  阅读(849)  评论(0编辑  收藏  举报