This post will show a simple example of REST service built on Micrsoft WEB API framework.
WEB API is an extensible framework from microsoft ASP.net which allows to built services to be accessed from different platforms.
Web API services can be accessed from any other platforms like mobile phone application (Android apps), desktop application or and web application.
For this example I am going to choose ASP.net Core web application.
Just follow the two steps and you are done.
Step 1 : Add new project with project type selected as in the image below.
Step 2: Select API type, as this post is intended to create a simple API
Now you are done. The project selected already prepare a nice example for the start.
Press F5 to execute and see the output in browser.
Create a new rest project.
In the URI link we can put the project link. In my case it is "http://localhost:56506/weatherforecast"
And click OK.
Then we click on the Play/Start button.
So the APi is ready to access from outside.
And thats all we need.
In the next post I will put some example of WEB API hosting.
WEB API is an extensible framework from microsoft ASP.net which allows to built services to be accessed from different platforms.
Web API services can be accessed from any other platforms like mobile phone application (Android apps), desktop application or and web application.
For this example I am going to choose ASP.net Core web application.
Just follow the two steps and you are done.
Step 1 : Add new project with project type selected as in the image below.
Step 2: Select API type, as this post is intended to create a simple API
Now you are done. The project selected already prepare a nice example for the start.
Press F5 to execute and see the output in browser.
The project is already created with a sample Model and controller.
The differnce between MVC and WEB API is that MVC returns HTML VIEW but the WEBAPI returns response either is json or raw or xml.
Now we test the rest api call. We are open to choose any tools for this. Postman, SoapUI and lot more other tools are available. I am going to use SoapUI.
At first we need to ensure that the project we just created is running. Now we open the SopUI.Create a new rest project.
And click OK.
Then we click on the Play/Start button.
So the APi is ready to access from outside.
And thats all we need.
In the next post I will put some example of WEB API hosting.



