Zone of Development

by Damiano Abballe

Category: Web API

Web API – Authentication using JWT

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

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

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

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 INSTALL]First 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

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

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] [UserType] [IUserCore] [UserCore] [UserController] [Startup] We have done and now with Postman, we can verify it works fine it: TIP #1We […]

Read More

Web API – How to use Polly library with Ocelot

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

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

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 – Unit Tests

In this post, we will see how to implement Unit Tests for the Web API created in the post: Docker – Web API and Sql Server. First of all, we open Visual Studio and we add a xUnit Test Project called TestWebApiServices: Then, we add a file called UserControllerUnitTests, where we will define all objects […]

Read More