Hey guys,
Code example:
```
/// <summary>
/// Get customers.
/// </summary>
[HttpGet("api/customers")]
public IEnumerable<Customer> GetCustomers()
{
...
}
```
When a consumer/client requests the defined route normally (http://mydomain.com/api/customers), he will get a result. But in case the consumer/client puts matrix parameters after the URI (http://mydomain.com/api/customers;name=John;surname=Bishop) then he will get a "404 Resource cannot be found".
I know that i can define these matrix parameters in the HttpGet attribute, but thats not the problem. The consumer/client should get the right response, whether the matrix parameters are defined or not in the HttpGet attribute.
So I think this is a bug, because matrix parameters aren't part of the resourcename, they are normal parameters like query params (?param1=value¶m2=value).
Kind regards,
Andy
Comments: Hi, We are not planning to add built-in support for matrix parameters in Web API because it causes ambiguity in URIs. If the route template has the template options explicitly listed then it should work, but of course you'd have to add every combination of parameters. This can all be implemented with a custom route (e.g. deriving from HttpRoute), but that is admittedly somewhat difficult. Thanks, Eilon
Code example:
```
/// <summary>
/// Get customers.
/// </summary>
[HttpGet("api/customers")]
public IEnumerable<Customer> GetCustomers()
{
...
}
```
When a consumer/client requests the defined route normally (http://mydomain.com/api/customers), he will get a result. But in case the consumer/client puts matrix parameters after the URI (http://mydomain.com/api/customers;name=John;surname=Bishop) then he will get a "404 Resource cannot be found".
I know that i can define these matrix parameters in the HttpGet attribute, but thats not the problem. The consumer/client should get the right response, whether the matrix parameters are defined or not in the HttpGet attribute.
So I think this is a bug, because matrix parameters aren't part of the resourcename, they are normal parameters like query params (?param1=value¶m2=value).
Kind regards,
Andy
Comments: Hi, We are not planning to add built-in support for matrix parameters in Web API because it causes ambiguity in URIs. If the route template has the template options explicitly listed then it should work, but of course you'd have to add every combination of parameters. This can all be implemented with a custom route (e.g. deriving from HttpRoute), but that is admittedly somewhat difficult. Thanks, Eilon