每当我运行我的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 }
);
请帮帮我。
答案 0 :(得分:0)
你应该发布/获得完整的参数:
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
或使用默认值。