Posts

Showing posts from May, 2022

Working with REST API

Image
  A REST API requires a host URL that acts as the primary address for your interactions. REST APIs also need a set of endpoints, which are unique addresses within-host URLs responsible for its functionality. Moreover, it is a good practice to document the endpoints, return value, data types, and other essentials of a REST API.  The below diagram is a high-level representation of the required organization of your code to create a REST API. You may have one or more databases that contain data that other applications might need. So, they will use the REST API that uses SQL and JDBC to interact with the database. REST APIs enable you to centralize all your basic logic in one place instead of rewriting it every time you want to create a new app as shown by the below image Now, APIs are designed to return the required data whenever a user calls them. However, when you use REST APIS, it not only returns the requested data but also presents it in a well-structured form for representation. A RE

API Throttling

Image
  API throttling is  the process of limiting the number of API requests a user can make in a certain period . An application programming interface (API) functions as a gateway between a user and a software application. For example, when a user clicks the post button on social media, the button click triggers an API call. If you are creating the API, it can be used by many clients. Sometimes some of the clients consume the API frequently without any limit. But if you want to limit consuming the API for a particular client within a certain time, then you can achieve it by  Rate Limiting Why do we need Rate Limiting? Rate Limiting helps us to protect against malicious bot attacks. For example, a hacker can use bots to make repeated requests to an API endpoint. Due to the number of repeated requests, resulting in will be service unavailable for others. This is called as the  Denial of Service (DoS)  attack. So, the rate limiting helps us from the DoS attack. Another use of the rate limitin

API Versioning in .NET 6.0

Image
When it comes to deploying an API for your .NET Core project, there has to be a checklist of the features that are necessary for this process. One such feature that tops this list is to implement API versioning in ASP.NET Core. It is a very essential approach to anticipate all the changes that may be essential after the API is published and clients start using it. This means that once the API is published to a production server, the ASP.NET core development team has to be very careful with any future changes they make. The reason behind it is that the new changes made by the developer must not break the existing client applications that are using the API. And this is why the concept of API versioning came into the picture. The versioning semantics stated in the Microsoft REST Guidelines are followed by the default API versioning configuration. API versioning in ASP.NET core is an approach that enables different clients to get distinct implementations of the same controller base when a