In which OSI layer is the REST API paradigm?

user4032676 picture user4032676 · Mar 25, 2015 · Viewed 9.6k times · Source

During an interview I was asked to classify the REST API paradigm between OSI Layers.

I thought it would have been between 5 and 7 layer; however, the interviewer said that it belongs only to the 5th layer because it is similar to RPC.

In my opinion, it can't be at 5 Session Layer only, because true REST API is stateless unlike session (HTTP session), so it could be placed as protocol on the 7th layer (application) because it is like HTTP (but why not in 6th as well?).

I searched online but I didn't find a clear answer (I know that some protocols are distributed ambiguously in OSI layers).

Maybe other people have a clearer opinion on this?

Answer

ProgramCpp picture ProgramCpp · Aug 25, 2017

REST is not a protocol for two systems to communicate. REST is an architecture style. It is mostly atop HTTP, the application layer.