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.

screenshot

  • 2
  • @EvgeniyZ so you can write the answer? - tym32167
  • one
    @ tym32167 So far there is no time. If you wish, I will not mind your answer) - EvgeniyZ
  • @EvgeniyZ is the same for me, I’m running to work :) - tym32167
  • @EvgeniyZ thank! write the answer as time will be - we increase your rating. - Jiraff537

1 answer 1

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:

  1. With 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.
  2. With the help of the attribute [Route("...")] - A rather convenient way, where for each control / method you can make your own ways (or even several) without unnecessary actions.
  3. Using 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!