This seems like an elementary question, but after many searches, I cannot find a direct explanation:
If I create a web application that can be accessed mainly through a web browser, but it will also support some API requests in a RESTful way, should there be a large degree of separation between the two?
On the one hand, it seems that most of the functionality is the same, with identical data presented in different representations (HTML and XML / JSON). But on the other hand, there are some things that I need to present to a browser that does not quite fit with the RESTful approach: how to get an empty form to create a new instance of a resource and how to get a pre-filled form to edit an existing resource.
Should these two different system access methods be routed through different controllers? Different methods in one controller? Exactly the same switch methods for a view type?
source
share