The rules for REST: How to be RESTful in HTTP/JSON APIs

Recently, I was trying to write a little client script for Apache Solr. It was just supposed to add some data, retrieve it, and delete it. I thought I’d just do obvious things. But as it turns out I actually had to read carefully.

You see, if I post to http://localhost:8983/solr/my_collection/update/json/docs a JSON document {"id": "1","title": "Doc 1"}, it shows up somewhere other than http://localhost:8983/solr/my_collection/update/json/docs/1.

Solr is essentially a search engine. Solr has a HTTP/JSON-based API. However, it isn’t exactly a REST API because it doesn’t really follow any of the rules for a well-defined REST interface. I whine about this sometimes. Maybe one day if I have time I’ll even fix it. (I work for Lucidworks, which does most of the development of Solr.)

To read this article in full or to leave a comment, please click here

InfoWorld

Play
Slider