I'm facing a problem where i am trying to call a REST API with some of the slashes encoded.
like so: www.foo.com/method/TV%20Shows%2fEntertainment
Now when calling on a browser that works fine, but when trying to call it using the HttpUtility
it looses it's encoding.
This:
'string FeedID = HttpUtility.UrlEncode(Collection.Category);
HttpWebRequest Request = (HttpWebRequest)WebRequest.Create("www.foo.com/method/" + FeedID);'
Outputs: www.foo.com/method/TV%20Shows/Entertainment
which of course ends up as a 404. Now i understand why and how this happens, i also found the solution here: http://msdn.microsoft.com/en-us/library/ee656542%28v=vs.100%29.aspx
now Comes my problem. When adding the said solution to the app config .NET does not recognize <schemeSettings>
as having a child <add>
.
the error is as follows. -The element cannot contain white space. Content model is empty. -the element schemeStettings cannot contain child element add because the parent element's content model is empty
<configuration>
<uri>
<schemeSettings>
<add name="http" genericUriParserOptions="DontUnescapePathDotsAndSlashes"/>
</schemeSettings>
</uri>
</configuration>
thanks