Book Image

Building RESTful Web Services with .NET Core

By : Gaurav Aroraa, Tadit Dash
Book Image

Building RESTful Web Services with .NET Core

By: Gaurav Aroraa, Tadit Dash

Overview of this book

REST is an architectural style that tackles the challenges of building scalable web services. In today's connected world, APIs have taken a central role on the web. APIs provide the fabric through which systems interact, and REST has become synonymous with APIs. The depth, breadth, and ease of use of ASP.NET Core makes it a breeze for developers to work with for building robust web APIs. This book takes you through the design of RESTful web services and leverages the ASP.NET Core framework to implement these services. This book begins by introducing you to the basics of the philosophy behind REST. You'll go through the steps of designing and implementing an enterprise-grade RESTful web service. This book takes a practical approach, that you can apply to your own circumstances. This book brings forth the power of the latest .NET Core release, working with MVC. Later, you will learn about the use of the framework to explore approaches to tackle resilience, security, and scalability concerns. You will explore the steps to improve the performance of your applications. You'll also learn techniques to deal with security in web APIs and discover how to implement unit and integration test strategies. By the end of the book, you will have a complete understanding of Building a client for RESTful web services, along with some scaling techniques.
Table of Contents (13 chapters)

To get the most out of this book

The reader should have prior knowledge of .NET Core and .NET Standard, along with basic knowledge of C#, RESTful Services, Visual Studio 2017 (as an IDE), Postman, Advanced Rest Client, and Swagger.

To set up the system, readers should have following on their machines:

Download the example code files

You can download the example code files for this book from your account at www.packtpub.com. If you purchased this book elsewhere, you can visit www.packtpub.com/support and register to have the files emailed directly to you.

You can download the code files by following these steps:

  1. Log in or register at www.packtpub.com.
  2. Select the SUPPORT tab.
  3. Click on Code Downloads & Errata.
  4. Enter the name of the book in the Search box and follow the onscreen instructions.

Once the file is downloaded, please make sure that you unzip or extract the folder using the latest version of:

  • WinRAR/7-Zip for Windows
  • Zipeg/iZip/UnRarX for Mac
  • 7-Zip/PeaZip for Linux

The code bundle for the book is also hosted on GitHub at https://github.com/PacktPublishing/Building-RESTful-Web-services-with-DOTNET-Core. In case there's an update to the code, it will be updated on the existing GitHub repository.

We also have other code bundles from our rich catalog of books and videos available at https://github.com/PacktPublishing/. Check them out!

Download the color images

Conventions used

There are a number of text conventions used throughout this book.

CodeInText: Indicates code words in text, database table names, folder names, filenames, file extensions, pathnames, dummy URLs, user input, and Twitter handles. Here is an example: "The Header must appear as the first child of the envelope, before the body element."

A block of code is set as follows:

<?xml version = "1.0"?>
<SOAP-ENV:Envelope
xmlns:SOAP-ENV = "http://www.w3.org/2001/12/soap-envelope"
SOAP-ENV:encodingStyle = "http://www.w3.org/2001/12/soap-encoding">
...
SOAP Message information goes here
...
</SOAP-ENV:Envelope>

When we wish to draw your attention to a particular part of a code block, the relevant lines or items are set in bold:

{
// GET: api/Products
[HttpGet]
public IEnumerable<Product> Get()
{
return new Product[]
{
new Product(1, "Oats", new decimal(3.07)),
new Product(2, "Toothpaste", new decimal(10.89)),
new Product(3, "Television", new decimal(500.90))
};
}
}

Bold: Indicates a new term, an important word, or words that you see onscreen. For example, words in menus or dialog boxes appear in the text like this. Here is an example: "Simple Object Access Protocol (SOAP) is an XML-based messaging protocol for exchanging information among computers."

Warnings or important notes appear like this.
Tips and tricks appear like this.