c# - Error in .NET Uri(string address) -
i have url:
http://localhost:8128/wcf8bcpgservices/eventservice/event/getpls/station=e2skgr&secondstation=%2fe2skgr class uri convert url :
http://localhost:8128/wcf8bcpgservices/eventservice/event/getpls/station=e2skgr&secondstation=/e2skgr i trayed call constructor
new uri("http://localhost:8128/wcf8bcpgservices/eventservice/event/getpls/station=e2skgr&secondstation=%2fe2skgr", true) no effect
why class uri convert %2f character '/'?
the 2 100% equivalent.
actually, it's necessary encode character '/' %2f if used in path (prior & ampersand). used after & ampersand (in query string) there no ambiguity, , can therefore used in unescaped format. uri class clever , knows this, , therefore removes unnecessary escaping applied in original url.
you creating apparently buggy behaviour not escaping of characters in url. either you've omitted ? character somewhere in original url, or need encode reserved characters in url remove ambiguity.
Comments
Post a Comment