簡體   English   中英

找不到與webapi中的請求URI匹配的HTTP資源

[英]No HTTP resource was found that matches the request URI in webapi

每當我運行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

或使用默認值。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM