when i do a GET with WebRequest.Create("http://abc/test.") i get 404 because according to fiddler the trailing dot gets stripped away by .NET and the web server needs the dot. how can i prevent that or work around it. any workaround is appreciated!
相关问题
- Generic Generics in Managed C++
- How to Debug/Register a Permanent WMI Event Which
- 'System.Threading.ThreadAbortException' in
- Bulk update SQL Server C#
- Should I use static function in c# where many call
Workaround in workaround tab at the official bug report:
https://connect.microsoft.com/VisualStudio/feedback/details/386695/system-uri-incorrectly-strips-trailing-dots?wa=wsignin1.0#tabs
.. seems to be valid. Basically, run this code to reset a static flag in .NET before working with System.Uri:
Demonstrated:
Re-wrote some of it to a function that dont require you to add any namespaces
This is a known problem that has come up on the Microsoft forums a few times.
The
Uri
class incorrectly thinks that all URIs act like Windows disk files where a trailing dot (for no file extension) is not relevant.http://social.msdn.microsoft.com/Forums/en-US/netfxbcl/thread/5206beca-071f-485d-a2bd-657d635239c9/
you change the dot into String to Hex
i think it's useful for u, because i used it in twitter API Oauth formatting