Joey Jay
Joey Jay

Reputation: 15

REST - Is the order of elements guaranteed when passing a list query string parameter?

If you are using the following syntax when making a REST request (query string), are the elements in the list guaranteed to be received in the same order?

https://example.com/someApi?id=12345&id=56789

Upvotes: 1

Views: 762

Answers (1)

JoelFan
JoelFan

Reputation: 38714

That depends on the code of the REST service. It certainly has access to the order, as the exact text of the query is part of the HTTP request, but depending on how it is coded, it may not act consistently or predictably regarding order of parameters.

Personally I would not consider it a good design to rely on the order. I'm not sure if this is addressed in any REST best practices.

Upvotes: 1

Related Questions