Articles → ASP .NET WEB API → Introduction To Web API
Introduction To Web API
What Is Web API
Create Your First Asp.Net Web API
- Open visual studio
- Click on File - New Project. A window appears as shown in the following figure
Click to Enlarge
- Another window appears as shown in the following figure
Click to Enlarge
Folder Structure
Click to Enlarge
Adding Controller
- Right click on the controller folder and click on Add – Controller..
Click to Enlarge
- A window appears as shown in the following figure
Click to Enlarge
- In the next window, enter the controller name and click on ‘Add’ (See the following figure).
Click to Enlarge
Add Code In Controller
public class TestController: ApiController {
public string Get() {
return "value";
}
}
Output
Click to Enlarge
Click to Enlarge