0

what I need;

api/GetCharacteristicsBulk?versionCode=RTUK8L1&language=2 go to this address.

 var urlCode = selectedVersionCode + "&" + "language=" + language;
 string url = QueryHelpers.AddQueryString($"{_urls.BaseUrl}{_urls.SapCharacteristicService.GetCharacteristicsBulk}", "versionCode", System.Web.HttpUtility.UrlDecode(urlCode)); 

when i run this; api/GetCharacteristicsBulk?RTUK8L1%262=RTUK8L1%25262. I get a result as above.

api/GetCharacteristicsBulk?versionCode=RTUK8L1&language=2 What should I do to get the output?

jyn
  • 3
  • 1
  • Please clarify your specific problem or provide additional details to highlight exactly what you need. As it's currently written, it's hard to tell exactly what you're asking. – Community Apr 27 '22 at 20:25

1 Answers1

1

The following uses a string AddQueryString(String, IDictionary<String,String>) overload will give you the correct result.

Dictionary<string, string> queryArguments = new()
{
    { "versionCode", "RTUK8L1" },
    { "language", "2" }
};

var results = QueryHelpers.AddQueryString(
    "api/GetCharacteristicsBulk", 
    queryArguments);

Result api/GetCharacteristicsBulk?versionCode=RTUK8L1&language=2

Karen Payne
  • 4,341
  • 2
  • 14
  • 31