2

I'm writing a RESTful webservice for Google AppEngine. The webservice provides a Java serialized object representation of a product based on a barcode and format. I was wondering what design methodology (if any) is preferred by RESTful design among the following options:

Option - 1:

 /product?barcode=1234&format=ean_13

Option - 2:

/product/1234?format=ean_13

Option - 3:

/product/ean_13/1234

I found quite a few references on REST on SO but nothing that addresses the use of query parameters to identify a representation.

My own understanding is that it shouldn't make a difference since the server is stateless in all three situations but I'm not sure.

1 Answer 1

3

It doesn't make a difference to REST those are just three different identifiers.

From a practical HTTP perspective, there are many deployed intermediary caches that will not cache representations that have query parameters. So if want to cache these representations in public caches then maybe option 3 is better.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.