http://www.nanotwitter/api/12/user/1
and http://www.nanotwitter/user/1?ver=12
are reasonable approachesAccept: application/edu.brandeis.nanotwitter-v2+json
REST
structured URIs, e.g.
GET /user/1
requests, for example, an html
or json
representation of that user information200 OK
means that the request succeeded and the data or action requested has been done404 Not Found
means that the URI was not valid or recognizedHEAD
http verb which can query for information about the resource without receiving the resource itself. This is especially good for very large resources which rarely change.Cache-Control: public
Various settings that tell caching proxies what can and cannot be doneETag: 737060cd8c284d8af7ad3082f209582d
A unique key that corresponds to the specific “version” of a response. In other words, if the version on the server has the same ETag as the client has, then the response can be truncated to just the header. Or the server can request the current ETag of the resource and choose not to ask for the body because it already has it.Expires: Wed, 02 Sep 2009 08:37:12 GMT
The content returned by the server is considered valid up to that date/time. It doesn’t need to request it again until then.Last-Modified: Mon, 31 Aug 2009 12:48:02 GMT
Similarly, this indicates when the resource was last modified. If the server has a copy with the same last-modified date time then it has the latest and doesn’t have to request it again./APIV1/users?id=1,12,33,1,22