Learn how the ION concept of Forms can be used to improve the discoverability of POST and PUT operations in a REST API.
- [Instructor] In a large restful API there won't just be resources that can be retrieved via GET. Clients will also need to post or put data to modify the application state. But how do clients know which fields and types of data to submit to an end point? The ION specification solves this problem with the concept of forms. An ION form is very similar to an HTML form. In HTML you have a form tag and a set of input tags that describe the form fields that can be submitted. Each form field has attributes that describe the data type, field name, whether the field is optional or required and so on.
The parent form element describes where the form should be submitted and what HTTP method should be used. Likewise ION forms are modeled on a ION collection of form field objects. The link relation for a form is form, or edit form, create form or query form, depending on what the form does. The value element of the collection contains the form elements which describe the fields that can be submitted with the form, and how they behave. The ION form describes the metadata about what can be submitted to a particular endpoint.
To submit a form a client will read that metadata and create a request with the proper method and parameters. Modeling what the client can send to the server and returning that form metadata in your resource or collection responses, solves the discoverability problem. With ION forms you clearly define what the client can submit to an endpoint reducing even further what you need to document out of band. We'll use ION forms in the land and hotel API to describe how a client can book a new reservation for a room and even model the query string parameters for searching and sorting.
- REST vs. RPC
- Using HTTP methods (aka verbs)
- Returning JSON
- Creating a new API project
- Building a root controller
- Routing to controllers with templates
- Requiring HTTPS for security
- Creating resources and data models
- Returning data and resources from a controller
- Representing links (HREFs)
- Representing collections
- Sorting and searching collections
- Creating forms
- Caching and compression
- Authentication and authorization for RESTful APIs
Skill Level Intermediate
Deploying ASP.NET Core Applicationswith Nate Barbettini57m 57s Intermediate
1. REST API Concepts
2. Building a Basic API
3. Securing the API
4. Representing Resources
5. Representing Links
6. Representing Collections
7. Sorting Collections
8. Searching Collections
9. Forms and Modifying Data
10. Caching and Compression
11. Authentication and Authorization
- 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.