Mastering ASP.NET Web API

Leverage ASP.Net Web API to build professional web services and create powerful applications.
Preview in Mapt

Mastering ASP.NET Web API

Mithun Pattankar, Malendra Hurbuns

2 customer reviews
Leverage ASP.Net Web API to build professional web services and create powerful applications.
Mapt Subscription
FREE
$29.99/m after trial
eBook
$25.20
RRP $35.99
Save 29%
Print + eBook
$44.99
RRP $44.99
What do I get with a Mapt Pro subscription?
  • Unlimited access to all Packt’s 5,000+ eBooks and Videos
  • Early Access content, Progress Tracking, and Assessments
  • 1 Free eBook or Video to download and keep every month after trial
What do I get with an eBook?
  • Download this book in EPUB, PDF, MOBI formats
  • DRM FREE - read and interact with your content when you want, where you want, and how you want
  • Access this title in the Mapt reader
What do I get with Print & eBook?
  • Get a paperback copy of the book delivered to you
  • Download this book in EPUB, PDF, MOBI formats
  • DRM FREE - read and interact with your content when you want, where you want, and how you want
  • Access this title in the Mapt reader
What do I get with a Video?
  • Download this Video course in MP4 format
  • DRM FREE - read and interact with your content when you want, where you want, and how you want
  • Access this title in the Mapt reader
$0.00
$25.20
$44.99
$29.99 p/m after trial
RRP $35.99
RRP $44.99
Subscription
eBook
Print + eBook
Start 14 Day Trial

Frequently bought together


Mastering ASP.NET Web API Book Cover
Mastering ASP.NET Web API
$ 35.99
$ 25.20
ASP.NET Core: Cloud-ready, Enterprise Web Application Development Book Cover
ASP.NET Core: Cloud-ready, Enterprise Web Application Development
$ 79.99
$ 56.00
Buy 2 for $35.00
Save $80.98
Add to Cart

Book Details

ISBN 139781786463951
Paperback330 pages

Book Description

Microsoft has unified their main web development platforms. This unification will help develop web applications using various pieces of the ASP.NET platform that can be deployed on both Windows and LINUX. With ASP.NET Core (Web API), it will become easier than ever to build secure HTTP services that can be used from any client.

Mastering ASP.NET Web API starts with the building blocks of the ASP.NET Core, then gradually moves on to implementing various HTTP routing strategies in the Web API. We then focus on the key components of building applications that employ the Web API, such as Kestrel, Middleware, Filters, Logging, Security, and Entity Framework.Readers will be introduced to take the TDD approach to write test cases along with the new Visual Studio 2017 live unit testing feature. They will also be introduced to integrate with the database using ORMs. Finally, we explore how the Web API can be consumed in a browser as well as by mobile applications by utilizing Angular 4, Ionic and ReactJS.

By the end of this book, you will be able to apply best practices to develop complex Web API, consume them in frontend applications and deploy these applications to a modern hosting infrastructure.

Table of Contents

Chapter 1: Introduction to Microservices and Service-Oriented Architecture
Services in SOA
Monolithic architecture
Introducing Microservices
Benefits of Microservices
Summary
Chapter 2: Understanding HTTP and REST
Software architecture
REST principles
REST architectural elements
HTTP
Version 2 of HTTP
Binary messages
Richardson maturity model
Summary
Chapter 3: Anatomy of ASP.NET Core Web API
A quick recap of the MVC framework
Inception of Web APIs and their evolution
Introduction to .NET Core
Introducing ASP.NET Core
Creating ASP.NET Core Project using Visual Studio IDE
Creating ASP.NET Core web applications on Linux/macOS
Creating ASP.NET Core web apps with Yeoman
ASP.NET Core request processing
Running the ASP.NET Core Web API project
Further reading
Summary
Chapter 4: Controllers, Actions, and Models
Introduction to controllers
Actions
Controllers
Summary
Chapter 5: Implementing Routing
Introducing Routing
ASP.NET Core Web API and Routing
Convention-based Routing
Template-based Routing
Attribute-based Routing
Multiple Routes
Routing constraints
Link generation
Routing best practices
Summary
Chapter 6: Middleware and Filters
Introducing middleware
HTTP request pipeline and middleware
Order of middleware
Built-in middleware
Writing custom middleware
Migrating HTTP modules to middleware
Introducing filters
Summary
Chapter 7: Perform Unit and Integration Testing
Uncle Bob's three rules of test-driven development
Summary
Chapter 8: Web API Security
Understanding Threat Model and OWASP
Applying SSL
CORS
Data Protection API
Protecting web API
Implementing JWT
Claims-based Authorizations
Identity management in web API
Summary
Chapter 9: Integration with Database
Brief introduction to Object Relational Mapper
Integrating ASP.NET Core Web API and an existing database using Entity Framework 6.x
Integrating using Dapper
Integrating with EF Core
Summary
Chapter 10: Error Handling, Tracing, and Logging
Basics of Logging in ASP.NET Core
MyWallet - Demo ASP.NET Core project
Logging errors to a file using NLog
Logging errors to a database using Serilog
Exception management in a MyWallet project
Summary
Chapter 11: Optimization and Performance
Measuring application performance
Asynchronous controller action methods
HTTP compression
Implementing in-memory caching
Working with distributed caching
Response caching
Summary
Chapter 12: Hosting and Deployment
Creating a demo ASP.NET Core Web API project
Publishing ASP.NET Core Web API project
Standalone web API
Deployment strategy
Deploying web API to IIS
Deploying a web API to Azure App Service
Publishing a web API to Windows virtual machine on Azure
Publishing a web API to Docker
Publishing a web API to EC2 on AWS
Publishing a web API to Linux
Testing PacktContacts web API
Summary
Chapter 13: Modern Web Frontends
PacktContacts - Recap of the demo web API project
Software pre-requisites for web frameworks
Consuming web APIs using Angular 4
Building hybrid mobile apps using Ionic 3
Building web apps using ReactJS
Consuming web APIs using JavaScript
Consuming web APIs using JQuery
Summary

What You Will Learn

  • Acquire conceptual and hands-on knowledge of ASP.NET Core (MVC & Web API)
  • Learn about HTTP methods, the structure of HTTP content, internet media types, and how servers respond to HTTP requests and their associated HTTP codes
  • Explore middleware, filters, routing, and unit testing
  • Optimize Web API implementations
  • Develop a secure Web API interface
  • Deploy Web API projects to various platforms
  • Consume your web API in front end application based on Angular 4, Bootstrap, and Ionic
  • Implement and explore the current trends in service architecture

Authors

Table of Contents

Chapter 1: Introduction to Microservices and Service-Oriented Architecture
Services in SOA
Monolithic architecture
Introducing Microservices
Benefits of Microservices
Summary
Chapter 2: Understanding HTTP and REST
Software architecture
REST principles
REST architectural elements
HTTP
Version 2 of HTTP
Binary messages
Richardson maturity model
Summary
Chapter 3: Anatomy of ASP.NET Core Web API
A quick recap of the MVC framework
Inception of Web APIs and their evolution
Introduction to .NET Core
Introducing ASP.NET Core
Creating ASP.NET Core Project using Visual Studio IDE
Creating ASP.NET Core web applications on Linux/macOS
Creating ASP.NET Core web apps with Yeoman
ASP.NET Core request processing
Running the ASP.NET Core Web API project
Further reading
Summary
Chapter 4: Controllers, Actions, and Models
Introduction to controllers
Actions
Controllers
Summary
Chapter 5: Implementing Routing
Introducing Routing
ASP.NET Core Web API and Routing
Convention-based Routing
Template-based Routing
Attribute-based Routing
Multiple Routes
Routing constraints
Link generation
Routing best practices
Summary
Chapter 6: Middleware and Filters
Introducing middleware
HTTP request pipeline and middleware
Order of middleware
Built-in middleware
Writing custom middleware
Migrating HTTP modules to middleware
Introducing filters
Summary
Chapter 7: Perform Unit and Integration Testing
Uncle Bob's three rules of test-driven development
Summary
Chapter 8: Web API Security
Understanding Threat Model and OWASP
Applying SSL
CORS
Data Protection API
Protecting web API
Implementing JWT
Claims-based Authorizations
Identity management in web API
Summary
Chapter 9: Integration with Database
Brief introduction to Object Relational Mapper
Integrating ASP.NET Core Web API and an existing database using Entity Framework 6.x
Integrating using Dapper
Integrating with EF Core
Summary
Chapter 10: Error Handling, Tracing, and Logging
Basics of Logging in ASP.NET Core
MyWallet - Demo ASP.NET Core project
Logging errors to a file using NLog
Logging errors to a database using Serilog
Exception management in a MyWallet project
Summary
Chapter 11: Optimization and Performance
Measuring application performance
Asynchronous controller action methods
HTTP compression
Implementing in-memory caching
Working with distributed caching
Response caching
Summary
Chapter 12: Hosting and Deployment
Creating a demo ASP.NET Core Web API project
Publishing ASP.NET Core Web API project
Standalone web API
Deployment strategy
Deploying web API to IIS
Deploying a web API to Azure App Service
Publishing a web API to Windows virtual machine on Azure
Publishing a web API to Docker
Publishing a web API to EC2 on AWS
Publishing a web API to Linux
Testing PacktContacts web API
Summary
Chapter 13: Modern Web Frontends
PacktContacts - Recap of the demo web API project
Software pre-requisites for web frameworks
Consuming web APIs using Angular 4
Building hybrid mobile apps using Ionic 3
Building web apps using ReactJS
Consuming web APIs using JavaScript
Consuming web APIs using JQuery
Summary

Book Details

ISBN 139781786463951
Paperback330 pages
Read More
From 2 reviews

Read More Reviews

Recommended for You

ASP.NET Core: Cloud-ready, Enterprise Web Application Development Book Cover
ASP.NET Core: Cloud-ready, Enterprise Web Application Development
$ 79.99
$ 56.00
Mastering ASP.NET Core 2.0 Book Cover
Mastering ASP.NET Core 2.0
$ 39.99
$ 28.00
.NET Design Patterns Book Cover
.NET Design Patterns
$ 31.99
$ 22.40
C# 7 and .NET Core: Modern Cross-Platform Development - Second Edition Book Cover
C# 7 and .NET Core: Modern Cross-Platform Development - Second Edition
$ 39.99
$ 28.00
Enterprise Application Architecture with .NET Core Book Cover
Enterprise Application Architecture with .NET Core
$ 39.99
$ 28.00
C# 7 and .NET Core Cookbook Book Cover
C# 7 and .NET Core Cookbook
$ 39.99
$ 28.00