Cenk Alti
Cenk Alti

Reputation: 2888

What is the best method for accessing a resource which is non-deterministic?

Lets say I am building a web service that is returning a random number?

Real world example: http://www.random.org/integers/?num=10&min=1&max=6&col=1&base=10&format=plain&rnd=new

random.org does this via GET method, which is not RESTful I think. Specs are saying that GET method should be idempotent.

What method would you suggest and what would your URL be?

Upvotes: 0

Views: 109

Answers (1)

Julian Reschke
Julian Reschke

Reputation: 42045

There is no problem here. Being idempotent has nothing to do with returning the same thing all the time.

Upvotes: 1

Related Questions