I am writing my program in C# .NET and I am trying to get my HttpClient to send a GET request exactly how the string is declared. No matter what I do, the GET request url is always changing.
For example,
client.GetAsync("http://example.com/?id=123%34");
// returns GET http://example.com?id=1234 (before it reaches the server)
or
client.GetAsync(new Uri("http://example.com/?id=123%34"));
// also returns GET http://example.com?id=1234 (before it reaches the server)
// I need the server to see http://example.com?id=123%34 before it reaches
// the server so it can convert the value 4 on the server side.
is making a request to "http://www.example.com/?id=1234". Which is not what I am hoping to achieve. I understand that %34 is the same as sending 4, but I need the webserver to see that %34 is incoming. I want the webserver to handle the percent encoding conversion.
Is there anyway to tell HttpClient to stop encoding/changing the GET request url? I was thinking about overloading the GetAsync() method but I honestly do not know where to begin.
I determined the problem by plugging my program into BURP and Fiddler. HttpClient is encoding my url before it reaches the server.