Web API Interview Questions

Total Questions: 2

1. What is Web API

By : Muhammad Waseem Last edited : 16 Nov 2024 Level: Basic

A: A Web API (Application Programming Interface) is a type of web application that provides an interface for other software applications to interact with it over the web. Unlike traditional web applications, Web APIs do not have a user interface. Instead, they expose endpoints that allow for data exchange and functionality access through HTTP requests.

2. Difference between Configure and ConfigureServices methods

By : Muhammad Waseem Last edited : 16 Nov 2024 Level: Basic

A: In ASP.NET Core (3.1), Configure and ConfigureServices are two essential methods used in the startup class to set up the application.

ConfigureServices: This method is used to register application services. It is where you add services to the dependency injection container. For example, you can add MVC services, Entity Framework services, and other custom services that your application will use. This method is called first during the application startup.

Configure: This method is used to define the application’s request pipeline. It is where you specify how the application responds to HTTP requests. You can add middleware components, such as routing, authentication, and error handling, to the pipeline. This method is called after ConfigureServices.

These methods were removed in new versions coming after (.NET 3.1)