The route template separator character '/' cannot appear consecutively - Attribute routing issue

前端 未结 4 1935
长情又很酷
长情又很酷 2021-02-05 01:04

The configuration has nothing to do with the error

This is my configuration for the Web API in App_Start/WebApiConfig.cs:

public static void Register(H         


        
4条回答
  •  自闭症患者
    2021-02-05 01:39

    The reason for the above error is that I am using an additional '/' in the route attribute for the action. The action defined in the above controller should be as follows:

        [HttpGet]
        [Route("marketdata/tickerinfo")]
        public IHttpActionResult TickerInfo(string currencyPair)
        {
    

提交回复
热议问题