Page 1 of 1

What is the difference between Web Services and Rest API?

PostPosted: Thu Sep 10, 2020 12:42 am
by tiloketi9
I am confused a bit in both of them as I have also develop some API using Slim micro-framework but still needs an expert opinion on the main difference between API and web services. routerlogin 192.168.l.l

Re: What is the difference between Web Services and Rest API

PostPosted: Thu Sep 10, 2020 10:48 am
by mgangl
It can certainly be confusing! An API is any application programming interface. So that could be within code modules (like using a java or python library), or a web service where the communication interface is over a network. Both are APIs, it's just the way in which the communication happens.

A RestAPI[1] is a specific implementation of a web service. It's characterized by using the HTTP protocol and defined actions (GET, POST, PUT, DELETE, and more). It's also stateless, but that might not be germane to the discussion here. One of the reasons people like Rest is because it's supported by pretty much every programming language (ubiquity!) which means python, php, perl, java, etc can all support it, so the end user doesn't have to worry about their language choice or rely on third party libraries (though they can certainly help).

Slim[3] is a framework for creating restful webservices, so you're doing rest already!