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

Writing code

So far, we have cooked the things required for writing code for our REST web client; in this section, we will be writing actual code:

  1. Add a simple code to call or consume your product APIs.

If you created a new project in the same solution (refer to step 1 of the section Cooking the web client), please make sure that the project Product API is running before you start your web client project.

  1. Add a new class (Ctrl + Shift + C) in the Client folder and name it RestSharpWebClient.
  1. Now open the RestSharpWebClient class and add the following code:
private readonly RestClient _client = new RestClient("http://localhost:10065/api/"); ...
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