java - Guidelines for RESTful Jersey User access -


i'm getting teeth designing restful web-app in java jersey.

i have design question.

lets want return messages user. have exposed messages @ /messages uri.

now when get call server, use @queryparam this?

so url return messages user 1234 localhost/messages?user_id=1234

or there better way this? note, have not got user authentication built yet, nor know how implement piece yet.

the best option in case use path parameter. url should like

localhost/messages/user/1234

the @path annotation's value relative uri path.

uri path templates uris variables embedded within uri syntax. these variables substituted @ runtime in order resource respond request based on substituted uri. variables denoted curly braces.

example :

   @path("/user/{userid}") 

Comments

Popular posts from this blog

android - Pass an Serializable object in AIDL -

How to provide Authorization & Authentication using Asp.net, C#? -

How to use Authorization & Authentication in Asp.net, C#? -