
[Route (..path..) ]
Routing is how Web API matches a URI to an action. As the name implies, attribute routing uses attributes to define routes. Attribute routing gives you more control over the URIs in your web API. For example, you can easily create URIs that describe hierarchies of resources.
Query parameters are a defined set of parameters attached to the end of a url. They are extensions of the URL that are used to help define specific content or actions based on the data being passed. To append query params to the end of a URL, a ‘?’ Is added followed immediately by a query parameter. To add multiple parameters, an ‘&’ is added in between each. These can be created by any variation of object types or lengths such as String, Arrays and Numbers
HTTPResponseMessage represents a HTTP response message including the status code and data. this gives us control over the returned status code and the choice between result data (JSON) and between a text message (which could contain an exception string, etc)
More topics covered:
- Query parameters default values
- Multiple path parameters
- HTTP status code enums
Links: