Tag Archives: Web API

Web API – ASP.NET Core 5

By | 23/06/2021

In this post, we will see how to create a WebAPI application with ASP.NET 5.0.For all information about ASP.NET Core 5, we can check the Microsoft Web Site. [VISUAL STUDIO]We open Visual Studio and we select ASP.NET Core Web Api project: In Additional information, we can decide to Enable Docker and Enable OpenAPI support.With Enable… Read More »

Web API – Json Server

By | 12/05/2021

In this post, we will see how to create a full fake Rest API for testing, using a Javascript library called Json-Server.Here, it is possible to find the project. HOW TO INSTALLFirst of all, we have to install node.js in our system, because Json Server is available as a NPM package.Then, using the command npm… Read More »

Web API – Simple Versioning

By | 05/05/2021

In this post, we will see how to create a simple versioning of a Web API method, using the Routing attribute.However, before starting, I want to remember that the best way for versioning a method it was describe here: Web API – Versioning We create a Web API project called TestAPI and we add a… Read More »

Web API – Tips

By | 17/03/2021

In this post, we will see two tips that could help us in order to create Web API. First of all, we create a simple Web API for managing a list of Users: [USER.CS] [USERTYPE.CS] [IUSERCORE.CS] [USERCORE.CS] [USERCONTROLLER.CS] [STARTUP.CS] We have done and now with Postman, we will verify it works fine: TIP #1We can… Read More »

Web API – How to use Polly library with Ocelot

By | 25/08/2020

In this post, we will see how to use the Polly library in the Microservices project created in the post: Web API – IHttpClientFactory.But, what is the Polly library?From the Official web site:“Polly is a .NET resilience and transient-fault-handling library that allows developers to express policies such as Retry, Circuit Breaker, Timeout, Bulkhead Isolation, and Fallback… Read More »

Web API – IHttpClientFactory

By | 19/08/2020

In this post, we will see how to use IHttpClientFactory, in order to invoke a Web API.IHttpClientFactory is available since .NET Core 2.1 and it provides a central location for naming, configuring and consuming logical HttpClients in our application. For this post, we will use the project created in the post: Web API – Gateway… Read More »

WEB API – Gateway with Ocelot

By | 07/08/2020

In this post, we will see how to create an API Gateway using Ocelot. First of all, why should we use an API Gateway?From Microsoft web site:“In a microservices architecture, the client apps usually need to consume functionality from more than one microservice. If that consumption is performed directly, the client needs to handle multiple… Read More »

Web API – Versioning

By | 18/03/2020

In this post, we will see how to manage the versioning in a .net core Web API service, using three different approaches:1) Query String-Based Versioning2) URL-Based Versioning3) HTTP Header-Based Versioning First of all, we open Visual Studio 2019 and we create a Web API project: If we run the application, this will be the output:… Read More »