2 Writing on the phone..
source | link

I would go with something like the following.

A path parameter gives you a unique uri for a resource like   

/userinfo/user/123 Where

Where 123 is the user id. Here I would return 404 as the specified resource did not exist. You could also validate the id and send back a 400 (Bad request) if the user id that was sent does not match a given pattern.

If we instead use query parameters to search for one or more resources like   

/userinfo/user?age=30 Here

Here I would return one or more resources in a list if found (200 response). If I dont find a resource matching my query I would return an empty list.

I would go with something like the following.

A path parameter gives you a unique uri for a resource like  /userinfo/user/123 Where 123 is the user id. Here I would return 404 as the specified resource did not exist. You could also validate the id and send back a 400 (Bad request) if the user id that was sent does not match a given pattern.

If we instead use query parameters to search for one or more resources like  /userinfo/user?age=30 Here I would return one or more resources in a list if found (200 response). If I dont find a resource matching my query I would return an empty list.

I would go with something like the following.

A path parameter gives you a unique uri for a resource like 

/userinfo/user/123

Where 123 is the user id. Here I would return 404 as the specified resource did not exist. You could also validate the id and send back a 400 (Bad request) if the user id that was sent does not match a given pattern.

If we instead use query parameters to search for one or more resources like 

/userinfo/user?age=30

Here I would return one or more resources in a list if found (200 response). If I dont find a resource matching my query I would return an empty list.

1
source | link

I would go with something like the following.

A path parameter gives you a unique uri for a resource like /userinfo/user/123 Where 123 is the user id. Here I would return 404 as the specified resource did not exist. You could also validate the id and send back a 400 (Bad request) if the user id that was sent does not match a given pattern.

If we instead use query parameters to search for one or more resources like /userinfo/user?age=30 Here I would return one or more resources in a list if found (200 response). If I dont find a resource matching my query I would return an empty list.