Skip to content

AddQueryParameter : Pipe character still encoded with false option #2207

Open
@ronando82

Description

@ronando82

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

var clientRest = new RestClient("http://xxx.yyy");
string resource = "/v1/xxxx/;
var request = new RestRequest(resource, Method.Get)
    .AddHeader("Accept", "application/json")
    .AddHeader("x-api-key", "myapikey")  
    **.AddQueryParameter("ids", "in:001|116", false);**

var responseRest =  clientRest.GetAsync<string>(request).Result;

the transmitted parameter is: ids=in:001**%7C**116

For example it's work with a slash / instead a pipe character |

    .AddQueryParameter("ids", "in:001/116", false);

the transmitted parameter is: ids=in:001/C116

Expected behavior

i would expect not encoding the pipe character

Desktop (please complete the following information):

  • OS: windows 11
  • .NET version 4.8
  • Version 111.1.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions