Search the web
Sign In
New User? Sign Up
rest-discuss · REST Discussion Mailing List
? Already a member? Sign in to Yahoo!

Yahoo! Groups Tips

Did you know...
Show off your group to the world. Share a photo of your group with us.

Best of Y! Groups

   Check them out and nominate your group.

Messages

  Messages Help
Advanced
Use verbs in URIs? [was: REST Best Practices]   Message List  
Reply Message #1519 of 14748 |
RE: [rest-discuss] Use verbs in URIs? [was: REST Best Practices]

Roger wrote:
> Those are the two ways that I see for implementing the purchase parts
> Web service. Are there other (better) ways? Any comments? /Roger

I'm not sure where my version of this verb/URI issue stands, but here is the way
I have designed it in my own efforts. As I mentioned before, I have a
pre-developed set of resource types, namely methods, components, topics, queues,
etc that are published in a node's hierarchical namespace. Each type is a
different type of abstraction, but all of them have methods that can be invoked.
Here is the way I see how each of the HTTP methods allow nodes to interact with
them:

------

HTTP GET - allows you to ask a node to return information about a resource at a
URI. In the case of a method resource, the results of a HTTP GET with
/Fruit/Apple/Washington/harvest might look like this:

<item key='harvest' type='method'>
<list>
<item key='baseName' value='harvest' />
<item key='baseName' value='cosecha' scope='/Language/ES />
<item key='optionalParam' type='boolean'>param5Name</item>
<item key='requiredParam' type='singleText'>param5Name</item>
<item key='requiredParam' type='multiText'>param4Name</item>
<item key='requiredParam' type='singleSelect'>param1Name</item>
<item key='optionalParam' type='multiSelect'>param2Name</item>
</list>
</item>

So a GET really only lets you to discover the resource. Obviously, if you had a
XSL converter, the above XML is easily converted into an HTML form that a
browser can use to can actually invoke the method.

HTTP PUT - instead of getting a pre-existing resource like the one above, it
allows you to effectively copy a resource in its current state to another node.
You are effectively publishing it on the destination node.

HTTP POST - in the case of method resources, like the one above, this is as
close as you get to the "verb" notion, where POST has optional/required
parameters that have been specified in the body and/or request line's query
string.

HTTP DELETE - deletes the published resource at the URI.

------

In essence, even though the URI provides you with the location of a method
resource on the network, it's not pointing to a verb per se. It is pointing to
the verb "as a noun". Once you POST to it, then that's when you submit
information to the resource being hosted by the server, and in this case, the
harvest method uses it to invoke behavior.

How far on or off base is this approach to REST? Do the REST purists out there
agree with it? Would this be more noun-like or verb-like?

Thanks,
Philip




Sat Jun 15, 2002 9:05 pm

philip_eskelin
Offline Offline
Send Email Send Email

Message #1519 of 14748 |
Expand Messages Author Sort by Date

This discussion on whether verbs should be used in URIs is excellent! Thanks Joe for raising this issue. It has certainly stimulated new ideas and questions...
Roger L. Costello
costello@...
Send Email
Jun 15, 2002
2:52 pm

Here's an alternate view of purchasing that might make the resource view more clear (and more like nouns): There are at least two stages of purchasing on the...
bhaugen32
Offline Send Email
Jun 15, 2002
4:18 pm

... The one I've seen used most often (mostly on contract agreements before downloading, not purchasing) is when a POST button is selected to agree, and then...
Mark Baker
distobj@...
Send Email
Jun 17, 2002
6:38 pm

... I'm not sure where my version of this verb/URI issue stands, but here is the way I have designed it in my own efforts. As I mentioned before, I have a ...
Philip Eskelin
philip_eskelin
Offline Send Email
Jun 15, 2002
9:06 pm

... I don't think I understand the question. GET is how you download things using HTTP. Paul Prescod...
Paul Prescod
papresco
Offline Send Email
Jun 15, 2002
9:59 pm

... method? ... things ... I know. I'm afraid I expressed my question very badly. I should have written "is there a pattern for how Web sites usually handle...
bhaugen32
Offline Send Email
Jun 16, 2002
11:41 am

... I guess the basic question is whether you *need* method objects. A REST-purist view would be that you should use methods as an implementation technique to...
Paul Prescod
papresco
Offline Send Email
Jun 15, 2002
10:06 pm

... My question was "what are you posting to?" and that's where I came up with the idea of creating method resources, which have URIs (if they are published),...
Philip Eskelin
philip_eskelin
Offline Send Email
Jun 17, 2002
5:24 pm

I'm struggling to catchup with rest-discuss, but found one point I wanted to respond to, only to lose the message. Basically, somebody was looking for an API...
Mark Baker
distobj@...
Send Email
Jun 17, 2002
5:33 pm

... I would love to hear more detail on your experiences using this API wrt REST I have been keeping tabs on Cocoon (http://xml.apache.org/cocoon/) as a...
Robert Leftwich
robert@...
Send Email
Jun 18, 2002
12:07 am

... I've worked with Cocoon a fair bit recently, there are 3 tutorials on developerWorks that I wrote if you want some more background on it. I've been...
Leigh Dodds
leighdodds2001
Offline Send Email
Jun 19, 2002
3:52 pm

... We Cocoon a lot here, and it can accept XML documents in a POST. The one thing that is nice about Cocoon is the sitemap, which is a mapping of logical...
Seth Ladd
bootyindustries
Offline Send Email
Jun 19, 2002
4:08 pm

... Servlet v2.x also has doDelete() and doPut(). Cocoon requires v2.2 so it should be able to be supported, but I don't know to what extent it actually is...
Robert Leftwich
robert@...
Send Email
Jun 19, 2002
6:09 pm

Hi Roger, I'm not sure that there is sufficient disagreement here to warrant "camps" in this discussion, but as usual, you've done a great job summarizing the ...
Joe Hsy
joe.hsy@...
Send Email
Jun 16, 2002
7:24 am

... You've identified two resources - what part tells it to take an action? and what action does it take? http://www.my-home.org/air-conditioning/on could test...
S. Mike Dierken
mdierken
Offline Send Email
Jun 16, 2002
7:21 pm

... application ... For me, those example are not 'natural', they are merely 'procedural'. A noun/object/resource based approach isn't any more natural either...
S. Mike Dierken
mdierken
Offline Send Email
Jun 16, 2002
7:34 pm

... I think that they vary widely. I think that after you do all of the negotiation and credit card stuff you should just have a "click here to download your...
Paul Prescod
papresco
Offline Send Email
Jun 16, 2002
10:51 pm

... That doesn't seem very smart from a business perspective. You're talking about an information product being sold for money, right? What's to stop me from...
Matt Gushee
mcgushee
Offline Send Email
Jun 16, 2002
11:00 pm

... What's to stop you from e-mailing the information you downloaded to all of your friends? Paul Prescod...
Paul Prescod
papresco
Offline Send Email
Jun 17, 2002
4:03 am

... Ah ... you're right. Nonetheless, I see a lot of businesses obfuscating URIs or creating them for each (business) transaction, presumably so that people...
Matt Gushee
mcgushee
Offline Send Email
Jun 17, 2002
11:06 am

... Well I did say that the download URI and license URI would usually be separate. By license URI I meant a license key that makes the download work. That key...
Paul Prescod
papresco
Offline Send Email
Jun 17, 2002
4:21 pm

... From: S. Mike Dierken [mailto:mdierken@...] ... I agree that what is "natural" is often a matter of opinion. And I certainly don't view these as...
Joe Hsy
joe.hsy@...
Send Email
Jun 17, 2002
8:25 pm

... From: Philip Eskelin [mailto:philip@...] ... the ... published), can ... and ... This is very cool and is very much what I was getting at. I can't...
Joe Hsy
joe.hsy@...
Send Email
Jun 18, 2002
8:43 am

... Yes, I agree with you. This is a concern of mine, and one of the reasons I've asked the group about their thoughts on it. What I really wanted to do was ...
Philip Eskelin
philip_eskelin
Offline Send Email
Jun 18, 2002
4:27 pm

... Yes. What you and Joe have been discussing is not REST, it's RPC with the method in the URI rather than in the body. With REST, a common way of ordering a...
Mark Baker
distobj@...
Send Email
Jun 18, 2002
4:59 pm

For this example, and to make it more RESTful, I would change it to this... ... NEW: Order order = new Order("http://www.parts-depot.com/orders/32432"); ...
Seth Ladd
bootyindustries
Offline Send Email
Jun 18, 2002
4:56 pm

... Got it. I see the difference. ... This is something that will also apply to my topic and queue abstractions. For example, when you publish to a topic,...
Philip Eskelin
philip_eskelin
Offline Send Email
Jun 18, 2002
5:52 pm

As a side note, in HTTP you can provide a header like : content-disposition: attachment; filename=suggested_name.ext for content-types other than octet-stream...
S. Mike Dierken
mdierken
Offline Send Email
Jun 18, 2002
5:39 pm

... From: "Philip Eskelin" <philip@...> ... For ... method ... the ... the ... state ... If you are modelling messaging with resources, and the URI...
S. Mike Dierken
mdierken
Offline Send Email
Jun 18, 2002
6:17 pm

... From: Seth Ladd [mailto:seth@...] ... I don't think calling methods and transferring state are necessarily mutually exclusive. Calling a method is a...
Joe Hsy
joe.hsy@...
Send Email
Jun 18, 2002
8:08 pm
Advanced

Copyright © 2010 Yahoo! Inc. All rights reserved.
Privacy Policy - Terms of Service - Guidelines - Help