Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I've always thought that the URL to use when searching articles is the same you would use when retrieving a collection of articles, just with the search terms or filters included as parameters, ie, /articles?q=terms

Approving articles could be as simple as posting TRUE to the "approved" attribute of an article, ie, /articles/1234/approved

You just need to make sure that every resource that can be modified or retrieved has a URL.



Or treat search as a first-class resource.


I wonder if it makes more sense to treat search as a first class method, i.e. issue an HTTP SEARCH request against a resource.


That could be done; WebDAV introduced several new methods to HTTP. The drawback is that your clients lose the ability to use standard HTTP libraries to talk to your service because you're using a non-standard set of methods. The 'Uniform' in URI and URL doesn't just apply to the resource identifiers; in a RESTful system the methods and representations both need to be uniform as well. That allows general-purpose clients to be able to interact with the service, and that was what made the web take off when earlier FTP and Gopher systems did not.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: