title: How to prevent double encoding of query string httpclient?
body: <p>I have query string with unicode characters, for ex. "<code>http://api.test.com?q=Túls Engeniería</code>".</p>
  
  <p>I send this query string in get request, <code>BuildUrl</code> method returns encoded string - <code>httpclient.GetAsync("http://api.test.com?q=T%u00fals+Engenier%u00eda")</code>, but in the request that I see in fiddler query is encoded additionally - "<code>http://api.test.com?q=T%25u00fals+Engenier%25u00eda</code>", How can I prevent this double encoding?</p>
  
  <pre><code>private async Task&lt;string&gt; MakeGetCall(string apiVersion, string url, string accessToken, NameValueCollection urlParameters = null)
  {
      var client = GetHttpClient();
      client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue(Constants.AUTHORIZATION_HEADER_VALUE_CONST_PART, accessToken);
  
      var result = await client.GetAsync(BuildUrl(apiVersion + url, urlParameters));
      result.EnsureSuccess();
  
      return await result.Content.ReadAsStringAsync();
  }
  
  private string BuildUrl(string baseUrl, NameValueCollection urlParameters)
  {
      string finalUrl = baseUrl;
  
       if (urlParameters != null)
       {
           var builder = new UriBuilder(string.Empty, baseUrl);
           var query = HttpUtility.ParseQueryString(builder.Query);
  
           query.Add(urlParameters);
  
           builder.Query = query.ToString();
           finalUrl = builder.ToString();
       }
  
       return finalUrl;
   }
  </code></pre>