- 右あなたのWEB APIプロジェクトを右クリックし、[Web]タブの[プロパティ
- 行くために行くと、あなたはこれがあなたのウェブAPIプロジェクトのベースURLを教えてくれます、プロジェクトのURLテキストボックス
- が表示されます。 (すなわち、http://localhost:8526)
WebApiConfig.csにアクセスして、URLルートパターンを確認します。
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web.Http;
namespace StandardWebApiTemplateProject
{
public static class WebApiConfig
{
public static void Register(HttpConfiguration config)
{
config.Routes.MapHttpRoute(
name: "DefaultApi",
routeTemplate: "api/{controller}/{id}",
defaults: new { id = RouteParameter.Optional }
);
}
}
}
お持ちの場合はルートのテンプレートのような -
routeTemplate: "api/{controller}/{id}" then your url will be like
ie. http://localhost:8526/api/ControllerName/89
、あなたがルートテンプレートでアクション名を含めるならば、ケースはへ
routeTemplate: "api/{controller}/{action}/{id}" then your url will be like
ie. http://localhost:8526/api/ControllerName/ActionName/89
そうです。感謝デニス。 – Vivek