0

When I have this URI and pass in the PlayerCode: 12345, everything is good.

https://abc.com/teams/players/12345

But when I have a list of 9000 player codes how do I pass the specific list of order code list for a GET operation?

While this question -asked before,here - suggests "an" answer I am not sure if it is "the" answer. I am not sure if I should be going for something like : https://abc.com/teams/players/?PlayerCodes=12345,23456,34567,45678.... and then have custom model binders to cater to the above.

Does passing in 9000 comma separated values in a URI make sense?

What would be the optimal solution for this scenario?

Community
  • 1
  • 1
GilliVilla
  • 4,998
  • 11
  • 55
  • 96

1 Answers1

0

unfortunately, when you get into the realm of big numbers like 9000, query string parameters will not be sufficient. I assume you are running your solution in IIS or IIS express, both of which have character limits on the query string of somewhere around 2048. In this scenario you can either choose to do an HTTP POST and post a body of the playerId's for the players you need to retrieve, or you could rework your architecture a bit and break your GET calls up into acceptable sizes.

tezromania
  • 797
  • 1
  • 5
  • 18