This question already has an answer here:
How to encode query string space with %20
instead of +
?
Because System.Web HttpUtility.UrlEncode()
gives the space with +
.
https://msdn.microsoft.com/en-us/library/system.uri.escapeuristring(v=vs.110).aspx
var encoded = Uri.EscapeUriString("How to encode");
OUTPUT:
How%20to%20encode