Tag Archives: Web API

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 »

Swagger – Tips

By | 08/10/2020

In this post, we will see some tips that can help us when we use Swagger.First of all, we open Visual Studio, we create a Web API project and add some files: [BOOK.CS] [BOOKCONTROLLER.CS] If we run the application, this will be the result: Now, we install the Swashbuckle.AspNetCore package, using the command Install-Package Swashbuckle.AspNetCore -Version 5.5.1 in… 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 »