更新时间:2021-06-25 21:23:49
封面
版权信息
Dedication
Packt Upsell
Why subscribe?
PacktPub.com
Contributors
About the authors
About the reviewer
Packt is searching for authors like you
Preface
Who this book is for
What this book covers
To get the most out of this book
Download the example code files
Download the color images
Conventions used
Get in touch
Reviews
Getting Started
Discussing RESTful services
REST characteristics
Resource-oriented architecture
URI
REST constraints
Client-server architecture
Stateless
Caching
Code on demand (optional)
Uniform interface
More explanation
POST versus PUT explained
Layered system
Advantages and disadvantages of RESTful services
Advantages
Disadvantages
ASP.NET Core and RESTful services
Summary
Building the Initial Framework – Laying the Foundation of the Application
SOAP
SOAP structure
Important points about SOAP
SOAP with HTTP POST
REST
Server and client are independent
Statelessness
Setting up the environment
Running the application
What's cooking here?
Interesting facts
Conclusions
Request and response
HTTP verbs
Postman
GET
Status codes
ASP.NET Core HTTP attributes
POST
PUT
DELETE
SOAP versus REST
Single-page application model
Service-oriented architecture
User Registration and Administration
Why authentication and limiting requests?
Database design
User registration
Setting up EF with the API
Configuring DbContext
Generating the controller
Calling the API from a page to register the customer
CORS
Adding basic authentication to our REST API
Step 1 – Adding the (authorize) attribute
Step 2 – Designing BasicAuthenticationOptions and BasicAuthenticationHandler
Step 3 – Registering basic authentication at startup
Adding OAuth 2.0 authentication to our service
Step 1 – Designing the Config class
Step 2 – Registering Config at startup
Step 3 – Adding the [Authorize] attribute
Step 4 – Getting the token
Step 5 – Calling the API with the access token
Step 6 – Adding the ProfileService class
Client-based API-consumption architecture
Item Catalogue Cart and Checkout
Implementing controllers
Generating models
Generating controllers
Product listing
Product searching
Adding to cart
Implementing security
Client-side AddToCart function
API calls for AddToCart
POST – api/Carts
PUT – api/Carts/{id}
DELETE – api/Carts/{id}
Placing orders