我的注册路线映射如下所示:
config.Routes.MapHttpRoute(
name: "WithActionApi",
routeTemplate: "api/{controller}/{action}/{id}",
defaults: new { id = System.Web.Http.RouteParameter.Optional }
);
config.Routes.MapHttpRoute(
name: "DefaultApi",
routeTemplate: "api/{controller}/{id}",
defaults: new { id = RouteParameter.Optional }
);
而且,控制器看起来像这样:
// [Route("???????????")]
[HttpGet]
public HttpResponseMessage GetPatientProviderData([FromUri] PatientProviderIncomingDto ppDto)
{
var response = Request.CreateResponse(HttpStatusCode.OK, _claimDetailService.GetPatientProviderData(ppDto.patientId, ppDto.facilityGroupId, ppDto.claimId));
return response;
}
我正在进行这样的GET调用:
http://localhost:xxxx/api/claims/GetPatientProviderData?patientId=180&facilityGroupId=9&claimId=21
但是,它没有达到URL。我希望它能够点击URL,并且提供的参数会转换为DTO。