0

Given the following URL

http://dev.website.com/authentication/tokenResponse?continue=%2ftransfer%3fINTCMP%3dILC%3aSAL%3aMS%3aGEN5b194e4b09097&code=0.ac.eJfRIO

When that is loaded into a System.Uri, .ToString() results in this:

http://dev.website.com/authentication/tokenResponse?continue=%2ftransfer%3fINTCMP%3dILC:SAL:MS:GEN5b194e4b09097&code=0.ac.eJfRIO

Notice the ':' are decoded, but the '/' are not.

If you look at Uri.QueryString.ToString(), you get this:

continue=%2ftransfer%3fINTCMP%3dILC%3aSAL%3aMS%3aGEN5b194e4b09097&code=0.ac.eJfRIO

Back to full encoding.

Any idea why Uri.ToString() seems to decode ':'?

Matt M
  • 1,093
  • 2
  • 11
  • 26

1 Answers1

0

After better Googling, found the answer here.

.ToString() does escaping. Best to use AbsoluteUri

Matt M
  • 1,093
  • 2
  • 11
  • 26