Skip to Content
Building RESTful Web Services with .NET Core
book

Building RESTful Web Services with .NET Core

by Gaurav Aroraa, Tadit Dash
May 2018
Intermediate to advanced
334 pages
7h 25m
English
Packt Publishing
Content preview from Building RESTful Web Services with .NET Core

Implementing a REST web client

RESTful services may or may not be a part of your web application, but we still need to understand how to implement them.

So, now it's time to do some real work. Add ProductController to the project, as well as the following action:

public ActionResult Index(){  var webClient = new RestSharpWebClient();  var products = webClient.GetProducts();  return View("ProductList", products);}

Take a look at the preceding code snippet. We have called the GetProducts method of RestSharpWebClient and populated our Index.cshtml view with a complete list of products.

To add another action method, enter the following complete code of our ProductController. The following code snippet contains the Index action method and gives us ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Hands-On RESTful Web Services with ASP.NET Core 3

Hands-On RESTful Web Services with ASP.NET Core 3

Samuele Resca
Microservices in .NET Core

Microservices in .NET Core

Christian Horsdal Gammelgaard

Publisher Resources

ISBN: 9781788291576Supplemental Content