I'm working with customers that are trying to send HTTP requests with the url path and query in a specific format (e.g. exactly as they received it from another party), even for unreserved characters like %4A J. They are blocked because HttpClient requires using System.Uri which always applies normalizations to the path and query. These normalizations are per RFC 3986, but are not desirable in a pass through situation.
How can we enable specifying an exact path and query to be sent in an HTTP request?
Example:
var input = "http://localhost/path%4A?query%4A";
var uri = new Uri(input);
Console.WriteLine(uri.AbsoluteUri);
Console.WriteLine(uri.PathAndQuery);
Displays:
http://localhost/pathJ?queryJ
/pathJ?queryJ
I'm working with customers that are trying to send HTTP requests with the url path and query in a specific format (e.g. exactly as they received it from another party), even for unreserved characters like %4A
J. They are blocked because HttpClient requires using System.Uri which always applies normalizations to the path and query. These normalizations are per RFC 3986, but are not desirable in a pass through situation.How can we enable specifying an exact path and query to be sent in an HTTP request?
Example:
Displays: