K
K
kovert992019-04-27 12:40:07
API
kovert99, 2019-04-27 12:40:07

How to properly combine REST API and JSON-RPC 2.0 in one API?

Good time, in the course of developing a REST API for web applications, the idea arose of using JSON-RPC 2.0 to perform all operations that are not related to direct CRUD interaction with resources.
For example, using JSON-RPC, one could implement the following requests:

  • User authentication followed by return of access_token
  • Sending a letter on post
  • Interaction with third party services

While for CRUD interaction with resources, regular REST would be used.
Has anyone encountered such a perversion? If so, what pitfalls can arise from the point of view of developing client applications?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
I
Ivan Shumov, 2019-04-27
@inoise

Faced, even once did. Only for such hands it is necessary to tear off because it is not REST. Any RPC was originally intended for asynchronous operations when REST is a synchronous protocol

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question