uzumaki naruto
uzumaki naruto

Reputation: 7119

implementing the REST way

I did not realise the power of REST until I started using scaffolds in rails. This makes life so simple. Now everytime I try to develop a web application I only think of those 6 verbs. But I have a doubt. How is search related to REST. Basically the search page which contain a form for the user to input a search term. which verb does this come under? Is it list?? and what does the search results come under? show?

Upvotes: 2

Views: 396

Answers (2)

tentonipete
tentonipete

Reputation: 5080

If I understand what you are saying properly, the search page wouldn't be a part of the rest service, but would submit to it.

The search results would be a list of whatever the first class object you had defined was. The Uri would describe the resource that was being displayed.

Retrieving resources is always done with a GET

eg: GET /cars?term=hyundai+green

Upvotes: 1

Maxim Sloyko
Maxim Sloyko

Reputation: 15906

Search is GET on the collection with some fancy attributes:

GET /articles?q=RESFful+Architecture&in_title=1

Something like that.

There are plenty of resources on the subject, check out Handling arbitrary actions, on ajaxpatterns, for example.

Upvotes: 6

Related Questions