Whether such implementation of the full Api?

There is a site on a small mvc framework for php. There are no ready-made cases for the implementation of the API, so I had to invent a Bicycle

So, you have a controller. It processes all the requests via the website.ru/api/...
This controller is, for example, section getUserById (website.ru/api/getUserById), which accepts incoming post or get request parameters. We process these parameters and will render the json.

Is there a rest api implementation?
You know, the rest api has methods such as post, put, delete, get. But I have these methods implemented using post/get parameters. Is this normal?
April 4th 20 at 00:28
2 answers
April 4th 20 at 00:30
Solution
API - application programming interface
So what is fully.
What about put and delete don't worry, common practice to pass a parameter method=put,delete
It happens that the web server simply does not support.
April 4th 20 at 00:32
Well, you have answered your own question. In the RESTful methodology for each entity must be an implementation of CRUD. On the same URL, just different HTTP methods:
  • POST /api/users (create)
  • GET /api/users/1 (read)
  • PUT /api/users/1 (update)
  • DELETE /api/users/1 (delete)

If you want to REST-architecture, read something like this. Then it will become clear whether you need such an implementation, or enough current.

And in addition to implementing the queries should be other layers: authorization (tokens / bearer / ip), caching, etc.
In the RESTful methodology for each entity must be an implementation of CRUD

No REST in anything about CRUD.
Grepom can go through dissertations, if you do not believe.

@Breana.Hintz34, it is important for API convenience for customers, and probably to developers.
Use only get/post is not a problem. Just understand how different processing of these requests (that is, refer to minimum specification or articles about what http). - arno_Tremblay commented on April 4th 20 at 00:35
@arno_Tremblay, well under the means of a RESTful implementation using HTTP, hence the GET/PUT/PATCH/POST/DELETE/OPTIONS. But in General, Yes, RESTful does not impose any restrictions. - Jacky.Kr commented on April 4th 20 at 00:38

Find more questions by tags PHPAPI