|Topics by week|
|1. Validation||6. |
|2. Identity||7. Creating a Web Service|
|3. Authentication and Authorization||8. Consuming a Web Service|
|4. Web Security||9. Docker Containers|
|5. Publishing to a Production Server||10. Term Project|
An ASP.NET Core Web API (aka web service) can be used in several ways:
As a way to add AJAX to Razor views to make them more efficient. The reservation web app in Ch. 20 of Freeman (2017) is an example of this.
As a way to create a web service.
There are two main scenarios in which web services are used:
To facilitate a Service Oriented Architecture in which different components of a system communicate over a network.
Advantages of using web services:
Allows computing services to be distributed across:
Provides a service that is:
Types of Web Services
SOAP - Simple Object Access Protocol
REST - Representational State Transfer
REST is not really a new protocol—it is just HTTP
Examples from OpenWeather:
Requests have these parts:
Start line—this includes the URL and things that are appended to it.
An HTTP Method (a verb) Common methods are: GET, POST, PUT, PATCH, DELETE.
Request target—normally a URL.
Header—this is optional and provides information about the request; such as the source of the request, the format of the body, etc. The information included depends on the type and content of the request. For requests that have a body, you can specify its format here.
Body—Not all requests have a body, but request methods that send data to be stored (POST, PUT, etc.) will have a body.
Resources - a REST service provides access to resources, which can be any kind of digital object: image, video, text, etc.
There is no restriction on the way resources can be represented, but the two most common means are:
Can be written in any programming language
Can run on any OS
Normally integrated into other software (many apps include code that calls a web service)
Can run on any type of platform - server, browser, mobile app, etc.
Server-side client code can be written in any language that runs on the server, but
ASP.NETCore MVC Lecture Notes by Brian Bird are licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.