• Post Reply Bookmark Topic Watch Topic
  • New Topic

Restful service - object details.  RSS feed

 
Mag Wells
Ranch Hand
Posts: 38
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Here is an interesting design problem that I am facing.

the following GET request gets me all the books


which is good, not syntax or any other issues.
Now consider a combobox that I would want to populate in certain html by books.

I would make the same call, but it would return unecessary data, and taking a tad longer, for a combobox to populate.

Any suggestions ?
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66207
151
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well, firstly you can't mean "combobox" (read HtmlHasNoComboBox).

Secondly, you didn't say whether you have the option to modify what's contained in the response, or to create alternative services. What sort of tips are you looking for?
 
Mag Wells
Ranch Hand
Posts: 38
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Bear Bibeault wrote:Well, firstly you can't mean "combobox" (read HtmlHasNoComboBox).

Secondly, you didn't say whether you have the option to modify what's contained in the response, or to create alternative services. What sort of tips are you looking for?


oops. actually combobox is more generic term. Anyways it is a drop down, you can imagine in an html page.
something like


Now, yes, I can modify what is in the response. But thing is that I would want to retain the original behaviour. as pasted in the previous post. Just that when I want to populate the combobox or rather <select> I want the shortened version. Now to be theoretically correct, I cannot modify the URLs i.e. say for example,
URL1 - GET details
and URL2- GET a shortened version.

because resource remains the same. ie. in the above case books.

I don't know, if creating alternative service wud be a good idea, then. I need a mechanism, idea or suggestion so as to get shortened reply for combobox box, else detailed version

may be something like


some samples would be great. I know that I can hack it one way or the other, butT i want to be closer to the standardS
 
Ivan Krizsan
Ranch Hand
Posts: 2198
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi!
I hope I have understood the question correctly.
Assuming you have the original URL that you use to retrieve data with full detail: http://www.ivan.com/books
An idea I come to think of is to use request parameters to select which book-related data to retrieve. If no parameters are present, then all details are returned.
Example:
http://www.ivan.com/books?name&authors - Retrieve book data with only book name and book authors fields.
Best wishes!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!