Here is a basic overview of RESTful Architecture in order to better understand how MVC works and Controllers function in relation with Models and Views.
Get: List the URIs and perhaps other details of the collection's members.
example: Google searches are get requests that display collections of data
Put: Replace the entire collection with another collection.
example: Changing passwords on Twitter issues a put request to the controller to replace the current password with the new password
Post: Create a new entry in the collection. The new entry's URI is assigned automatically and is usually returned by the operation.
example: A Twitter post sends a Post request to the controller that then renders the new view with the Post.
Delete: Delete the entire collection.
example: When a Twitter status is deleted, a Delete request is sent and the controller tells the model to delete the post in the database and then renders the new view.
No comments:
Post a Comment