I may have a trivial question of what it is:
("list")
what it is for, what else besides the list happens and where you can read about it in detail, thank you.
googled, thought a lot, tried to guess on his own, decided to appeal specifically to you.
I may have a trivial question of what it is:
("list")
what it is for, what else besides the list happens and where you can read about it in detail, thank you.
googled, thought a lot, tried to guess on his own, decided to appeal specifically to you.
In essence, this is one type of routing , where you specify the URL path to the specified method. In your case, he will receive the following address:
Post >> http://site/api/relations/list
api/relations is [Route("api/[Controller]")]list is [HttpPost("list")]There are 3 types of routing:
MapRoute - Here you simply specify (for example in the configuration) the desired paths of your project, and then it will be distributed according to the standard for the whole project.[Route("...")] - A rather convenient way, where for each control / method you can make your own ways (or even several) without unnecessary actions.Http[Verb] Attributes - As for me, this is the best way, where you can not only specify the desired route, but also specify the type (post / get / put, etc.) of the incoming request. For API, this type of routing is not replaceable.In general, good luck in programming!
Source: https://ru.stackoverflow.com/questions/853009/
All Articles