在webapi中找不到与请求URI匹配的HTTP资源
本文关键字:HTTP 资源 URI 请求 webapi 找不到 | 更新日期: 2023-09-27 18:19:26
每当我运行web api服务时,我都会得到低于响应的结果
No HTTP resource was found that matches the request URI 'http:/xxxxxxxxxxx/api/values/Signup_v3?RefferalCode="4566"&Emailid=pavan@fffffmmm&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 }
);
请帮帮我。
您应该发布/获取完整的参数:
api/Values/Signup_v3?RefferalCode={RefferalCode}&EmailID={EmailID}&Password={Password}&Mobile={Mobile}&UserName={UserName}&DeviceID={DeviceID}&PlatformID={PlatformID}&DeviceToken={DeviceToken}&Mobilemodel={Mobilemodel}&Appversion={Appversion}&MobileOS={MobileOS}
例如:
http://localhost:6642/api/Values/Signup_v3?RefferalCode=12&EmailID=12&Password=12&Mobile=12&UserName=12&DeviceID=1&PlatformID=1&DeviceToken=15&Mobilemodel=345&Appversion=4&MobileOS=4
或使用默认值。