Multiple actions were found that match the request Web API

在WebAPI工程入口不对外公开的接口不能使用public。

        [HttpPost]
        public string PostRequest([FromBody] Model model)
        {
            ///
        }
        //Validate方法是不对外公布的,得弄成私有的。
        private bool Validate(Model model)
        {
            return true;
        }
时间: 2024-10-06 08:06:26

Multiple actions were found that match the request Web API的相关文章

Multiple actions were found that match the request

Web API错误信息: {"Message":"An error has occurred.","ExceptionMessage":"Multiple actions were found that match the request: \r\nSystem.Collections.Generic.IEnumerable`1[Lybing.Invoice.DataContract.Product] Get(Lybing.Invoic

Multiple types were found that match the controller named 'Home'. (weird error)

found the error, because I changed the namespace and assembly name, then on the bin folder the old dll was still there, so it looks like the mvc engine searches for controllers in the entire bin folder. 也就是说报此错误的可能原因是bin目录下有就的dll产生了干扰. http://stackov

MVC 区域内默认控制器不能访问(Multiple types were found that match the controller named ‘Index')

异常处理汇总-后端系列 http://www.cnblogs.com/dunitian/p/4523006.html 错误信息 和主页的默认控制器冲突了,修改下Areas里面的默认控制器就可以了 MVC 区域内默认控制器不能访问(Multiple types were found that match the controller named 'Index')

{"ret":100029,"msg":"client request's api name is not existed"}

AFNetworking对Path的定义问题: 如果把这一串:https://graph.qq.com/user/get_user_init 定义成baseURL 那么后面加的任何Path,都会在Path前面加上一个/ 这个跟NSURL有关系,AF的baseURL是用NSURL实现的,NSURL会把你给的字符串拆分成scheme,host,path,query这些东西 然后AF再处理这个NSURL,而NSURL并不仅仅是一个字符串 给 getPath加参数就行了: {"ret":100

Blocking Cross Origin API request for /api/contents Creating Notebook Failed An error occurred while creating a new notebook.

anacoda安装的jupyter,使用nginx进行了转发,远程访问可以进去,但是创建文件和创建目录都会报错 浏览器页面报错: 第一次使用jupyter创建python时错误:Creating Notebook Failed An error occurred while creating a new notebook. 后台日志报错: [W 11:06:56.582 NotebookApp] Blocking Cross Origin API request for /api/content

Web API Request Content多次读取

使用OWIN 项目中要做日志过滤器 新建类ApiLogAttribute 继承ActionFilterAttribute ApiLogAttribute :  ActionFilterAttribute public override Task OnActionExecutingAsync(HttpActionContext actionContext, CancellationToken cancellationToken) { string result = null; Stream str

python+unittest+xlrd+request搭建API测试框架

实现功能 1.可在表格中进行编写用例 2.自动执行表格中测试用例 3.对响应结果进行深度断言,可定位预期结果与测试结果的不同值与位置 4.形成HTML格式的测试报告 源码可在githube中下载: https://github.com/wcnszbd/Mytest 先附上效果图: 再上代码: 结构图 1 #!/usr/bin/env python 2 # -*- coding: utf-8 -*- 3 # @Time : 2017-07-28 18:07 4 import xlrd 5 impo

Dynamics CRM2016 Web API之Retrieve Multiple

之前的博文仅仅介绍了通过记录的primary key来查询单条记录或者单个属性值,本篇介绍多条记录的查询方法 var filter = "? $filter=name eq '123'"; var req = new XMLHttpRequest() req.open("get", Xrm.Page.context.getClientUrl() + "/api/data/v8.0/accounts/" + filter, false); req.

Asp.Net WebAPI Get提交、Post提交处理

1.启用跨域提交 <system.webServer> <httpProtocol> <customHeaders> <add name="Access-Control-Allow-Origin" value="*" /> <add name="Access-Control-Allow-Methods" value="GET, POST" /> </custom