Explore the Web API default conventions for binding parameters.
- [Instructor] In the route definitions…that we just looked at…we saw a parameter named ID…being matched from a value in the path.…Web API allows us to match parameters…from a couple of different locations,…from the URI and from the request body.…For the URI parameters they could either come from…the query string or be matched as part of the path.…By default, Web API tries to get…the value from the URI for simple types,….net primitives like integer, Boolean, decimal, string,…date time, double and so forth.…
For more complex types Web API tries to…deserialize the value from the message body.…Let's try this with a simple example…where we'll try to bind from all three sources…for perimeters, from the URI path, from the query string,…and from the request body.…In the exercise files for 01_02 in the start folder…I've created a TourController for you already.…Inside that TourController there are a get method,…as well as a post, put, patch, and a delete method.…
Each of those methods match…the five most common http verbs…
AuthorJonathan "J." Tower
- Convention-based routing
- Binding your code to an HTTP request
- Validating models
- Using attributes to route requests
- Customizing attribute routes
- Data serialization and model binding
- Error handling
- Using exception filters and exception loggers
- API documentation and testing
- Securing your API
Skill Level Beginner
1. Controllers and Actions
3. Data Serialization and Model Binding
4. Error Handling
5. API Documentation and Testing
Next steps1m 38s
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.Cancel
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.