My two cents: think about the kinds of things you might want to do with the
phone call after it's done. In that case you would have a call resource:
/phone/call/5551234
...and a GET on it might return a representation of it that has, for
example, its transcript, or whatever.
So it seems reasonable to allow a PUT here or a POST (waves hands
frantically over the differences).
Best,
Laird
On Thu, Aug 26, 2010 at 4:03 PM, PhuDuc Nguyen [via Jersey] <
ml-node+5467031-537226792-158506_at_n2.nabble.com<ml-node%2B5467031-537226792-158506_at_n2.nabble.com>
> wrote:
> I often find myself in situations where I need to execute a method that
> does not belong with any of the CRUD operations. What if I just want to
> execute an action where no resource is being created, read, updated, or
> deleted. For example, what if I'm controlling something like a phone and I
> want to instruct it to call someone. If this were a SOAP service, I would
> just define my Java interface to have something like
>
> public boolean call(int phoneNumber);
>
> However, I'm a bit confused as how this translates into RESTful style. What
> then does the HTTP operation become? I'm certainly not deleting anything,
> not reading anything, not updating anything. You could make the argument
> that an "event" is being created...a "phone call event" is being created
> maybe? What then would the URI look like?
>
> http://<server>/phone/5551234
> with POST as the HTTP operation? Shouldn't that be the URI for creating a
> phone number? I'm trying to adhere to RESTful principles and I'm curious
> about good style. Would you define something like:
>
> http://<server>/phone/callevent/5551234
>
> thanks in advance,
> PDNWPS
>
>
>
>
>
>
> ------------------------------
> View message @
> http://jersey.576304.n2.nabble.com/style-question-WRT-REST-principles-tp5467031p5467031.html
> To start a new topic under Jersey, email
> ml-node+576304-1218448111-158506_at_n2.nabble.com<ml-node%2B576304-1218448111-158506_at_n2.nabble.com>
> To unsubscribe from Jersey, click here<http://jersey.576304.n2.nabble.com/template/TplServlet.jtp?tpl=unsubscribe_by_code&node=576304&code=bGpuZWxzb25AZ21haWwuY29tfDU3NjMwNHw4OTk4MzY1OTI=>.
>
>
>
--
View this message in context: http://jersey.576304.n2.nabble.com/style-question-WRT-REST-principles-tp5467031p5467100.html
Sent from the Jersey mailing list archive at Nabble.com.