Using JSON Helper Methods
Explore how to utilize JSON helper methods in Blazor WebAssembly for reading, adding, and updating data via HTTP requests. Understand how to use HttpClient.DeleteAsync to delete data and streamline API consumption. This lesson helps you efficiently manage data operations when building web apps using ASP.NET Web API.
We'll cover the following...
There are three JSON helper methods. There is one for reading data, one for adding data, and one for updating data. Since there is not one for deleting data, we will use the HttpClient.DeleteAsync method to delete data.
Relationship between the HTTP Methods and the JSON Helper Methods
JSON Helper Method | HTTP Method | Action |
|
| Read |
|
| Create |
|
| Update |
|
| Delete |
The preceding table indicates the relationship between the JSON helper methods and the HTTP methods.
Tip: We can also use the
HttpClientservice and JSON helper methods to call external web API endpoints. By way of an example, see the “Building a Weather App as a Progressive Web App (PWA)” chapter. ...