to get a specific other user's cart, you would query GET /users/<user_id>/carts and then a follow-up GET directly to the cart resource
regarding authorization, just pass a session token in the query string if you're against implicit headers/cookies.
to get a specific other user's cart, you would query GET /users/<user_id>/carts and then a follow-up GET directly to the cart resource
regarding authorization, just pass a session token in the query string if you're against implicit headers/cookies.
The payload of the requests will be encrypted (assuming HTTPS), but the urls are not. So I think you're opening the door to session hijacking in this way.
edit: I was wrong about this. The URL will be confidential in transit. Thanks for setting me straight.
I still think it is not a great design, but for different reasons: the url will be visible in your browser history and on the server side in the logs.
hostname is also encrypted (cause it's a header), though your insecure DNS pre-queries will give that away to anyone listening on the wire.
this is not necessarily true. if you're managing users, then they are resources like anything else. but users can also act as contexts for operations and access, including auth/prmissions, audit/logging.
when the user is acting as a context, it should be implicit and stored in a session, with an initialized token after login.
http://stackoverflow.com/questions/6068113/do-sessions-reall...
though your sessions do maintain some server context. you cannot let the client decide when to expire a session, for example. pure REST is a pipe dream. there are many things that work sub-optimally if adhering to strict rest as it pertains to http. see the second answer in that thread.