Quantcast
Channel: ASPNETWebStack Issue Tracker Rss Feed
Viewing all articles
Browse latest Browse all 7215

Edited Issue: Passing multiple arrays to get request? [1385]

$
0
0
I have a WebAPI 2 ApiController with the following GET method:

public IEnumerable<MyData> Get([FromUri]string[] id, [FromUri]string[] filter, int? count)
My http request looks like this:

http://localhost/myapp/api/mycontroller?id=123&id=456&filter=A&filter=B&count=5
And life is good. But here's where I'm missing something. The following query string also works:

http://localhost/myapp/api/mycontroller?id=123&id=456&count=5
Notice that the `filter` parameter is missing. Not a problem. But then this fails:

http://localhost/myapp/api/mycontroller?id=123&id=456&filter=A&filter=B
The `count` parameter seems to be required, even though it is marked as nullable. If I just add it back in with no value it works again, even if the `filter` or `id` parameters are completely left out.

This seems strange to me, what's going on?

Viewing all articles
Browse latest Browse all 7215

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>