-4

So I'm new to the concept of Web Api's and Web application from the ASP.Net Core web Api Visual studio 2017, and I honestly cant tell the difference between creating/using a web application to a web api. they both use the same routing patterns, like why create an api when i could just as easily create a web application?

  • 3
    An API typically means a REST service that is accessed by other applications or services, with GET, POST, PUT, and DELETE operations. An application makes me think of a user interface. I don't think there's a strict interpretation of the terms. Use whatever your business case requires. – Dan Wilson Apr 25 '18 at 18:19
  • Application program interfaces are for other programs to interface with your application, applications generally have a front end for human users and my also have a program interface builtin. – kpie Apr 25 '18 at 18:20
  • The terms are not mutually exclusive. Web API is a set of tools provided by Microsoft (a framework, if you will) for creating a specific set of functionality in a web application. When you create a Web API project, you are creating a web application. A specific kind of one. – David Apr 25 '18 at 18:24
  • Well, on a web-application you have a complete *application* including a view - the **client**. An API is just - well - an API. – MakePeaceGreatAgain Apr 25 '18 at 18:26
  • https://stackoverflow.com/questions/37643506/what-is-difference-between-a-web-application-and-web-api – Alexan Apr 25 '18 at 19:55

1 Answers1

2

They are two completely different things. With typical Web sites, there is a fairly tight coupling to the client. By using Web API, adding new features over time is far less likely to break the client. So your application can evolve. Web API is exploding because a huge amount of clients can consume such systems. In addition, Web API is more likely to support new clients down the road.

More information here, and here.

Incidentally, the routing pattern for Web API is NOT the same:

routes.MapHttpRoute(
    name: "API Default",
    routeTemplate: "**api**/{controller}/{id}",
    defaults: new { id = RouteParameter.Optional }
);
IrishChieftain
  • 15,108
  • 7
  • 50
  • 91