0

I have a request with thousands of IDs specified - far too many to stick them in the URI. My options seem to be:

  • Make it a POST with a Body
  • Make it a GET with a Body - but I don't know if WebAPI supports this

How do you send a huge GET request with webApi?

SB2055
  • 10,654
  • 29
  • 87
  • 185
  • 1
    A POST is usually the preferred approach. See this post for more details: http://stackoverflow.com/questions/5216567/is-this-statement-correct-http-get-method-always-has-no-message-body – StfBln Mar 15 '17 at 20:54
  • http://stackoverflow.com/questions/15814160/how-to-pass-complex-object-to-asp-net-webapi-get-from-jquery-ajax-call – Gonzalo.- Mar 15 '17 at 20:54
  • 1
    Per the HTTP spec, GET supports a body, however, servers are *supposed* to ignore it. See [here](http://stackoverflow.com/a/983458/47589) –  Mar 15 '17 at 21:18

1 Answers1

0

I think more correct way is create the parameters by POST with parameter id and after that get data by GET with that parameter. But there will be two queries and it can be not suitable. In that case you can simply use POST.

Igor Kovalev
  • 128
  • 8