|
From: Chris B. <cbr...@re...> - 2010-11-24 18:18:03
|
Yes, the URL is unique. However, consider this scenario: In the RESTful world (API integration world): api.foo.com/things/1234 That's the RESTful representation of Thing 1234. Cool. Now, in a web app that is "downstream" from there, we have a UI and set of forms and whatnot that create Things. There are many other clients too, but it's the web UI that I'm thinking of in this message. That Web UI has something like this: fooweb.com/web/admin/things/1234 or maybe fooweb.com/web/admin/viewThing.jsf?id=1234 In that case, the whole URI of that Thing is not meaningful. While it does identify the Thing, it does not give me the pure entity ID that's useful in the web app. So I must parse. Or I need to provide that ID somehow, hence my initial proposal. Of course it's possible that I'm thinking about this wrong in which case I'm happy to be educated... -CB On 11/24/2010 10:58 AM, Michael Musgrove wrote: > The url in location header is already unique so why do you need to > refer to it by another id. > > Some rest folk say that urls should be opaque so they would advise > against parsing it for meaningful information. > > Mike > > >> Hi List, >> >> I have many typical entity resources to which a POST will create a new >> instance and return the resource URL as a Location header. However, I >> find myself parsing this header in my application clients frequently to >> strip out the ID of the newly-created entity. >> >> While the logic is trivial, I feel like it's silly to do this when I >> control the server logic as well. I'm thinking about adding and >> Entity-Id header to store the uniqe ID of whatever entities are created >> at the various resources. Is there any reason why this is bad practice, >> RESTfully speaking? I would of course leave the standard Location >> header(s) there. >> >> Thanks, >> >> Chris >> >> ------------------------------------------------------------------------------ >> Increase Visibility of Your 3D Game App& Earn a Chance To Win $500! >> Tap into the largest installed PC base& get more eyes on your game by >> optimizing for Intel(R) Graphics Technology. Get started today with the >> Intel(R) Software Partner Program. Five $500 cash prizes are up for grabs. >> http://p.sf.net/sfu/intelisp-dev2dev >> _______________________________________________ >> Resteasy-users mailing list >> Res...@li... >> https://lists.sourceforge.net/lists/listinfo/resteasy-users > > > ------------------------------------------------------------------------------ > Increase Visibility of Your 3D Game App& Earn a Chance To Win $500! > Tap into the largest installed PC base& get more eyes on your game by > optimizing for Intel(R) Graphics Technology. Get started today with the > Intel(R) Software Partner Program. Five $500 cash prizes are up for grabs. > http://p.sf.net/sfu/intelisp-dev2dev > _______________________________________________ > Resteasy-users mailing list > Res...@li... > https://lists.sourceforge.net/lists/listinfo/resteasy-users |