Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

non-RESTful vs. RESTful

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?

like image 724
Vijitha Hegna Avatar asked Sep 03 '15 07:09

Vijitha Hegna


People also ask

What is RESTful and non RESTful web services?

Difference Between REST vs RESTful. REST denotes a server that shares the JSON files with a client over HTTP. It is a complete version that doesn't seem completely dependent on JSON, XML or HTTP. A Restful is an advanced form of web exchange server that shares any other documents or JSON to develop any new applications ...

What is the difference between REST and non REST API?

Put simply, there are no differences between REST and RESTful as far as APIs are concerned. REST is the set of constraints. RESTful refers to an API adhering to those constraints. It can be used in web services, applications, and software.

What is an example of a non RESTful API?

The classic example of a non-RESTful system using HTTP is something which treats HTTP as if it was a transport protocol, and with every request sends a POST of data to the same URI which is then acted upon in an RPC-like manner, possibly with the connection itself having shared state.

What makes an API not RESTful?

A REST API must not define fixed resource names or hierarchies (an obvious coupling of client and server). A REST API should never have “typed” resources that are significant to the client. A REST API should be entered with no prior knowledge beyond the initial URI (bookmark) …


1 Answers

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

like image 74
clockworks Avatar answered Dec 31 '22 23:12

clockworks