What is the difference between Web Services and Rest API?

What is the difference between Web Services and Rest API?

Postby tiloketi9 » Thu Sep 10, 2020 12:42 am

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
Last edited by tiloketi9 on Sat Sep 12, 2020 12:26 am, edited 1 time in total.
Posts: 1
Joined: Thu Sep 10, 2020 12:34 am

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

Postby mgangl » Thu Sep 10, 2020 10:48 am

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!

[1] https://en.wikipedia.org/wiki/Representational_state_transfer
[2] https://en.wikipedia.org/wiki/SOAP
[3] http://www.slimframework.com/
Posts: 24
Joined: Wed Apr 27, 2016 1:31 pm

Return to Data Access