emilly
emilly

Reputation: 10538

Rest Webservice vs Web application?

I have recently gone through rest web services(mainly spring). But I did not find much difference between rest based web service and web application.

In rest based web service, we have @RestControllerand in web application we have @Controller. The one difference from dev perspective I know is in rest that we have more verbs like PUT, DELETE etc. but in web app we mainly use POST/GET . That is from receiver side. Even sender will just sends the http request for rest like sent in web application

Both maps the incoming url with method , mentions return format etc.

Yes there will be difference in authentication as in web application it will be form based authentication but web service it will be different like header based or something else.

So is there any major difference in protocol/sender/receiver or any perspective ?

Upvotes: 0

Views: 2090

Answers (2)

Marufur Rahman
Marufur Rahman

Reputation: 89

Web services are typically from application to application or machine to machine to exchange data it and the raw data usually is not human or browser friendly, ( encoded in json or xml or other agreed formats). The encoded data maybe later transformed or wrapped into pretty web pages as an output to view object data to be browser human-friendly for viewing.

Upvotes: 0

M Sach
M Sach

Reputation: 34424

From spring-frameworkrestcontroller-vs-controller

The key difference between a traditional Spring MVC controller and the RESTful web service controller is the way the HTTP response body is created. While the traditional MVC controller relies on the View technology, the RESTful web service controller simply returns the object and the object data is written directly to the HTTP response as JSON/XML

Rest of the things are more or less same

Upvotes: 1

Related Questions