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