I have a REST WCF service that has a method that gets a parameter as a string. This string can contain slash / character. It makes my request wrong, as I think the URL goes wrong.
When requesting it and getting response (WebRequest.GetResponse()) throws "The remote server returns an error: (400) Bad Request." exception.
My request: http://localhost:17679/testmethod/DmC/TCGlOLz1EbEwqAls5Q==\nh2cQzTizSBg=
I tried to use Uri.EscapeDataString, but it does not help, I get the same exception as above. After this conversion my request looks like this: http://localhost:17679/testmethod/DmC%2FTCGlOLz1EbEwqAls5Q%3D%3D%0Ah2cQzTizSBg%3D
If I pass a string without slash in the string it works as I want.
How can I pass slash and other 'url sensitive' characters to a WCF REST service?
Thx.
UPDATE: I solved it, you can see it in my answer bellow.