I'm using HttpClient (Dot Net 5) and I'm trying to get an entity from a DotNetCore web service by specifying it's id in the URL.
- It works if the id does not contain any characters that need encoding.
- It fails (HTTP 404) if the id contains a slash (/).
- Web service diagnostics confirm that the request does not reach the method.
Other clients such as Postman or Swagger work fine.
Example of failing:
string id = "Person/65-C";
var httpResponse = await httpClient.GetAsync(string.Format("/persons/{0}", System.Web.HttpUtility.UrlEncode(id)));