Answer the question
In order to leave comments, you need to log in
Is such an implementation a full-fledged API?
There is a site on one small mvc framework php. There are no ready-made cases for implementing the API, so I had to reinvent my wheel
. So, there is a controller. It processes all requests for site.ru/api/...
This controller has, for example, a getUserById section (site.ru/api/getUserById), which accepts incoming post or get request parameters. We process these parameters and render json.
Is such a rest api implementation?
I know, rest api has methods like post, put, delete, get. But I have these methods implemented through post / get parameters. Is it normal?
Answer the question
In order to leave comments, you need to log in
API - application programming interface
So that is the full extent.
Don't worry about put and delete, it's common practice to pass the parameter method=put,delete
Sometimes the web server just doesn't support them.
Well, you answered your own question. In a RESTful methodology, each entity must have a CRUD implementation. On the same URL, only the HTTP methods differ:
If you want exactly REST architecture, read something like this . Then it will become clear whether you need such an implementation or the current one is enough.
And besides the implementation of requests, there should be other layers: authorization (tokens / bearer / ip), caching, etc.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question