Skip to content

Commit 646b8a2

Browse files
authored
Merge pull request #145 from watson-developer-cloud/gh-140-ExportParameterCamelCase
fix: camelcase values in querystring
2 parents d9b4941 + e1ee8b1 commit 646b8a2

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/IBM.WatsonDeveloperCloud/Http/Extensions/UriExtensions.cs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,11 @@ public static Uri WithArguments(this Uri uri, params KeyValuePair<string, object
2929
string queryString = string.Join("&",
3030
from argument in arguments
3131
let key = WebUtility.UrlEncode(argument.Key)
32-
let value = argument.Value != null ? WebUtility.UrlEncode(argument.Value.ToString()) : string.Empty
32+
let value = argument.Value != null ?
33+
argument.Value is bool ?
34+
WebUtility.UrlEncode(argument.Value.ToString().ToLower()) :
35+
WebUtility.UrlEncode(argument.Value.ToString()) :
36+
string.Empty
3337
select key + "=" + value
3438
);
3539
return new Uri(

0 commit comments

Comments
 (0)