每当我运行我的Web API服务我得到下面的响应没有HTTP资源发现匹配的请求URI中的WebAPI
No HTTP resource was found that matches the request URI 'http:/xxxxxxxxxxx/api/values/Signup_v3?RefferalCode="4566"&[email protected]&Password=44444444&DeviceID=sdsdsd&PlatformID=3&DeviceToken=dsfnjdsdfkj&Mobilemodel=nojik&Appversion=2.2&MobileOS=hjkdd'.
我的服务是:
[AcceptVerbs("GET","POST")]
public HttpResponseMessage Signup_v3(string RefferalCode, string EmailID, string Password, string Mobile, string UserName, string DeviceID, int PlatformID, string DeviceToken, string Mobilemodel, string Appversion, string MobileOS)
{
}
我webapiconfig文件:
public static void Register(HttpConfiguration config)
{
config.Routes.MapHttpRoute(
name: "DefaultApi",
routeTemplate: "api/{controller}/{action}/{id}",
defaults: new { id = RouteParameter.Optional }
);
请帮帮我。
http://stackoverflow.com/questions/24769379/why-is-it-that-no-http-resource-was-found-that-matches-the-request-uri-here –
记得'id'是你的路线参数。更好的方法是创建一个包含所有这些属性的POCO类,然后将其作为单个对象进行发布。 –
您没有在您的网址中提供用户名和移动设备。这是造成的问题 – VIVEK