-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
AddQueryParameter : Pipe character still encoded with false option #2207
Comments
RestSharp doesn't encode query parameters when it is told not to. For example, this simple test passes: [Fact]
public void Should_not_encode_pipe() {
var client = new RestClient("http://example.com");
var request = new RestRequest("resource");
request.AddQueryParameter("ids", "in:001|116", false);
var actual = client.BuildUri(request);
var expected = new Uri("http://example.com/resource?ids=in:001|116");
actual.Should().Be(expected);
} However, what I found now is that the I fixe in my PR but for .NET < 6 the code uses an obsolete |
Sorry, closed prematurely. It still has issues with how some characters are encoded, it's different per framework. Will look at it again soon. |
Describe the bug
i use AddQueryParameter with false attribute to prevent encoding my string but it doesn't work.
Example : .AddQueryParameter("ids", "in:001|116", false);
To Reproduce
the transmitted parameter is:
ids=in:001**%7C**116
For example it's work with a slash
/
instead a pipe character|
the transmitted parameter is:
ids=in:001/C116
Expected behavior
i would expect not encoding the pipe character
Desktop (please complete the following information):
The text was updated successfully, but these errors were encountered: