Possibly the most important aspect of HTTP that you need to know is that each HTTP request identifies an HTTP method (also called an HTTP verb). The default method for most REST clients is GET. Another method you might have already encountered is POST, often used with HTML forms. The following table summarizes the methods most often handled by RESTful web services:
Method | Description/Status code returned |
GET | Requests information from the application. Think of GET as a database query. In most RESTful web services, if the GET request is accompanied by an ID, only the document matching that ID is returned. Otherwise, all documents are returned. If the request succeeds, typically status code 200 (OK) is returned. If only a subset of the requested information is returned, your RESTful application can set a status code of 206 (partial content). |
POST | A POST request contains a block of data. The associated RESTful web service typically performs a database... |