.net HttpWebRequest URL Encoding in URL Parameters

Is the HttpWebRequest class to automatically encode a URL parameter? I created an HttpWebRequest with the URL " http://test.com/124?param=%2Ea ". When I commit the fiddler trace, I see that the HTTP request request becomes " http://test.com/124?param=.a , that is,"% 2E "becomes". ".

I tried setting up a debugger in my code, and I'm sure that the URL I passed to HttpWebRequest is " http://test.com/124?param=%2Ea " Do you know that HttpWebRequest does this automatically? And how can I turn it off?

+4
source share
1 answer

, , %2e URL-, ., , URL- , , ?

, Uri / .. -, . , this SO answer, MS MS Connect

app.config web.config:

<uri> 
    <schemeSettings> 
        <add name="http" genericUriParserOptions="DontUnescapePathDotsAndSlashes" /> 
    </schemeSettings> 
</uri>
0

Source: https://habr.com/ru/post/1657644/


All Articles