1

What is the difference between creating a Rest plugin with the Rest API and creating a route/controller that returns a jsonResponse ?

In which case i have to create a custom route/controller with a jsonResponse ?

0

The main difference is the authentication and authorization, is Rest Solution you should provide different way to authentication and authorization to access to the endpoint. but in Controller,route solution is MVC base solution that drupal and it's ACL ( role and permissions) hanle the access to the results not REST authorization methods like basic_auth, oauth2 etc.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.