non-RESTful vs. RESTful

Vijitha Hegna picture Vijitha Hegna · Sep 3, 2015 · Viewed 14.4k times · Source

I am really new to programming, and having some trouble understanding the concept of RESTful APIs. I've read about REST and RESTful APIs. I've looked through the questions already asked here in SO, but can't seem to get any better understanding of the subject.

In my network programming class I'm working with socket programming. There are two parts, part A and part B, in the task.

In part A I've programmed a server that responds to GET and POST. The server either retrieves the file asked for by the client, or writes to the file. (HTTP-protocol is used).

In part B I'm to use HTTP to implement a RESTful application. Basically it is a message server with the ability to handle GET, POST, PUT and DELETE. In this part the server is to create and interact with an xml-file. I understand how the methods work. But what I really don't understand is the following:

Why is the server in part A non-RESTful, while it is RESFTful in part B?

Answer

wasabi picture wasabi · Sep 3, 2015

REST is an architectural style (not a protocol like SOAP, not a technology itself or even not an implementation, it is basically a set of a rule), This architecture offers some constraints for using HTTP. If you stick by this architectural constraints while using HTTP, it is called RESTful, otherwise, it is not-RESTful.

list of these architectural constraints here. resource and more details wikipedia