Getting started with WebApi

First, tell me what do you mean by the interface in general? Ok, I give you examples of the interface, GUI is a graphical user interface. Why it came into the picture? because normal users are very different from technical developers of any application. Why windows operating system is famous? Cause anybody can use it easily, it has a start button, and everything is visible, the best part is the user does not need to know the internal mechanism, they just click and boom gets the result. This is the purpose of any interface in the world. An interface hides the complexity from a normal user.

Now come to the developer's world, suppose you are a java developer and I am a dot net developer, I have developed a wonderful application where a user logs in and by his location the app gives him the nearest bars location and related details. You liked this app and you want to use such a service in your java application, what will you do? You ask a favor to me to give my code. But you can't integrate it in your application cause it's written in .Net, and this is the first problem, the second problem is, why should I give you my code, I will simply give you an interface but I know you are a programmer, not a nontechnical person, so I will give you an interface which at least you as a programmer could understand and my code will still be hidden from you, you can only use the methods that I had created but can not see how actually it is working, and you really don't need it as well, you just need an interface though not graphical a simple interface that you understand, such interfaces for programmers by programmers are called Application programming interface. No matter which device, no matter which programming language. An interface for all. For example, google map service is an API, If you want to integrate it into your application, then you do not need to know how is it working, you just need to call the methods simple URLs like http://googlemap/nearestbars. Here nearest bars is actually a method which is representing some resources but for you googlemap is an interface and every method is like buttons on windows.

WebApi enables a developer to take advantage of existing web HTTP protocol which intern work on every platform and language. Meaning if you have worked hard and wrote beautiful code for your application in java now you are going to develop another app where you need the same data but this time you are making a javascript-based app, will you write everything again, I think no, so make an API (a service) host it and consume it from anywhere. And you can create such restful services with asp.net web API easily.

Welcome to the journey of becoming WebApi expert,if you are a beginner and really want to be a professional, then follow the below steps:-

  • Go through each article one by one without skipping any of them.
  • Try to implement and practice what you have learnt in the article by yourself.
  • Use your imagination and thinking power and ask these questions to yourself:-
    • Why did i read this article?
    • What i learned after reading this article?
    • Should i open visual studio and try to implement something?
    • Am i getting errors?ok ,which type of error
      • Is it compilation error?
      • Is it Run time error?
      • Can i solve this myself?
      • Can my friends solve this problem?
      • Should i ask this question on Stackoverflow?