usually after POST request need to be done redirect to new url (at least it’s a right proactice to build obvious web applications).
What to do with RESTfull app after POST is received and completed ? Should I send to client 302 Header with new url ?
And another question related with REST approach: what about pagination, ordering and filtering the generic GRID ? I’m talking about usual javascript grids which has such functions like searching, sorting, filtering and paginating how it is applicable with REST approach (it is GET ?) ?
There is actually a dedicated status code to return after a resource-creating POST request: 201 Created. It is accompanied by a
LocationHTTP header which points to the newly reported response.As to pagination, the usual approach is to define the subset of the data you want to retrieve with GET query parameters. For instance, to retrieve the first 50 entries of an employee list, the request could look like this:
And the next 50 like so:
and so on.