D
D
Dilik Pulatov2017-07-21 17:40:56
Yii
Dilik Pulatov, 2017-07-21 17:40:56

Why use a REST API when you can do everything manually?

Hello!
I'm just wondering (maybe I'm wrong) but please explain why you need to use the REST API?
for example, I will make my admin panel js framework .. when working, I need to get create, delete data from the database. And they said at this point you need to use the REST API. I read a few docs on the REST API .. if I understood correctly there is a simple structure that we will do manually. That is, we get the data, edit and delete it .. And so the question is
Can I use my structure? for example get all posts by sort edit delete and just return all the result in json format. and here I can make my own conditions.. that is, get data (using my own filter, JOIN) or create or edit data according to several conditions, etc. at the same time, I simply create my own controller and action that will return responses according to the condition.
Can this be done? what is the best REST API? Maybe I almost didn’t understand why the REST API is needed,
if it’s not difficult to explain in detail about the REST API (and my version of what is the minus and plus)
(by the way, if I wrote it wrong somewhere, then sorry for the mistakes)

Answer the question

In order to leave comments, you need to log in

2 answer(s)
N
Nikita, 2017-07-22
@bitver

REST is just a recommendation so that others will understand you later. The use of json in REST does not contradict the principles of REST, many even confuse one with the other, although it's like comparing stone with butter.

D
Dmitry, 2017-07-22
@backender_ru

and where it is written, about the obligatory order of input and output data? This is just a recommendation on how to send data and how to return it.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question