title: Python request with authenticated proxy without exposing username and password.
body: <p>I am using request library to connect to an api and get data. I have the proxy to connect and it works with  <a href="https://stackoverflow.com/questions/34079/how-to-specify-an-authenticated-proxy-for-a-python-http-connection/3942980#3942980">AuthenticatedProxy</a></p>
  
  <p>This is how my code looks. </p>
  
  <pre><code>import requests
  s = requests.Session()
  url = "https://testapi"
  urlkey = “testkey”
  proxies = {'https': 'http://&lt;UserName&gt;:&lt;Password&gt;@proxy_url:8080'}
  resp = s.get(url, params={'key':urlkey }, proxies = proxies)
  content = resp.content
  print content
  </code></pre>
  
  <p>Username and Password is exposed here and I want to avoid that. How can I acheived that ? Can i ask request to use defaultCredentials or 'account that is running the python script' credentials ?</p>
  
  <p>In .net,  following config works: </p>
  
  <pre><code>&lt;system.net&gt;
      &lt;defaultProxy enabled="true" useDefaultCredentials="true"&gt;
        &lt;proxy proxyaddress="https://testapi:8080" bypassonlocal="True"/&gt;
      &lt;/defaultProxy&gt;
    &lt;/system.net&gt;
  </code></pre>
  
  <p>Thanks all. 
  Similar question <a href="https://stackoverflow.com/questions/35746251/making-python-requests-using-a-proxy-without-specifying-username-and-password-u">here</a>.</p>