Reputation: 41
I have an endpoint
[HttpGet, Route("ICDCodes/BySearchText/{searchText}", Name = "GetIcdCode")]
When I'm trying to pass some string with special characters (50$%b/de90 - for example) on localhost - 204 is returned (as it should be because in database there's no such code), but the same endpoint with the same parameter on Dev environment returns 404.
In Appinsights URL for dev looks like this - ICDCodes/BySearchText/50$%25b/de90
Is this because slash is not encoded, or because "%" is encoded to "%25", or both? But why it works locally?
Upvotes: 0
Views: 114
Reputation: 5052
Technically it shouldn't work even on your local because there is a / in the url and it means new route section. by the way you can use * for route parameter and it ignore the / in the url as a new route section, like this:
[HttpGet, Route("ICDCodes/BySearchText/{*searchText}", Name = "GetIcdCode")]
Upvotes: 1