Category Archives: Web API

Web API – Authentication using JWT

By | 21/07/2021

In this post, we will see how to implement token authentication in ASP.NET Core 5.0 Web API using JWT.But first of all, what is JWT?“JSON Web Token (JWT) is an open standard (RFC 7519) that defines a compact and self-contained way for securely transmitting information between parties as a JSON object. This information can be… Read More »

Web API – Faker.js

By | 30/06/2021

In this post, we will see how to use the Javascript library called Faker.js for generating fake data for various areas, including address, commerce, company, date, finance, image, random, or name.Here, it is possible to find the project. [HOW TO INSTALL]First of all, we have to install node.js in our system, because Faker is available as… Read More »

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 »