<p dir="auto">Impossible to unset the User-Agent, if I pass <code class="notranslate">headers = { 'User-Agent': None }</code>, urllib3 UA will be set as a fallback</p>

<p dir="auto">I expect to not have any User-Agent sent to the webserver</p>

<p dir="auto"><a target="_blank" rel="noopener noreferrer nofollow" href="https://user-images.githubusercontent.com/2185992/148385822-0a88da4f-9165-4f66-94e1-6769c6607f9b.png"><img src="https://user-images.githubusercontent.com/2185992/148385822-0a88da4f-9165-4f66-94e1-6769c6607f9b.png" alt="image" style="max-width: 100%;"></a></p>
<h2 dir="auto">Reproduction Steps</h2>
<div class="highlight highlight-source-python notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="import requests

headers = {
    'User-Agent': None
}

proxies = {
    'https': 'http://127.0.0.1:8888'
}

response = requests.post(
    'http://localhost:8888/',
    data={'name': 'test'},
    headers=headers,
    proxies=proxies,
    verify=False
)

exit()"><pre class="notranslate"><span class="pl-k">import</span> <span class="pl-s1">requests</span>

<span class="pl-s1">headers</span> <span class="pl-c1">=</span> {
    <span class="pl-s">'User-Agent'</span>: <span class="pl-c1">None</span>
}

<span class="pl-s1">proxies</span> <span class="pl-c1">=</span> {
    <span class="pl-s">'https'</span>: <span class="pl-s">'http://127.0.0.1:8888'</span>
}

<span class="pl-s1">response</span> <span class="pl-c1">=</span> <span class="pl-s1">requests</span>.<span class="pl-en">post</span>(
    <span class="pl-s">'http://localhost:8888/'</span>,
    <span class="pl-s1">data</span><span class="pl-c1">=</span>{<span class="pl-s">'name'</span>: <span class="pl-s">'test'</span>},
    <span class="pl-s1">headers</span><span class="pl-c1">=</span><span class="pl-s1">headers</span>,
    <span class="pl-s1">proxies</span><span class="pl-c1">=</span><span class="pl-s1">proxies</span>,
    <span class="pl-s1">verify</span><span class="pl-c1">=</span><span class="pl-c1">False</span>
)

<span class="pl-en">exit</span>()</pre></div>
<h2 dir="auto">System Information</h2>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="$ python -m requests.help"><pre class="notranslate"><code class="notranslate">$ python -m requests.help
</code></pre></div>
<div class="highlight highlight-source-json notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="{
  &quot;chardet&quot;: {
    &quot;version&quot;: null
  },
  &quot;charset_normalizer&quot;: {
    &quot;version&quot;: &quot;2.0.9&quot;
  },
  &quot;cryptography&quot;: {
    &quot;version&quot;: &quot;&quot;
  },
  &quot;idna&quot;: {
    &quot;version&quot;: &quot;3.3&quot;
  },
  &quot;implementation&quot;: {
    &quot;name&quot;: &quot;CPython&quot;,
    &quot;version&quot;: &quot;3.10.1&quot;
  },
  &quot;platform&quot;: {
    &quot;release&quot;: &quot;10&quot;,
    &quot;system&quot;: &quot;Windows&quot;
  },
  &quot;pyOpenSSL&quot;: {
    &quot;openssl_version&quot;: &quot;&quot;,
    &quot;version&quot;: null
  },
  &quot;requests&quot;: {
    &quot;version&quot;: &quot;2.27.1&quot;
  },
  &quot;system_ssl&quot;: {
    &quot;version&quot;: &quot;101010cf&quot;
  },
  &quot;urllib3&quot;: {
    &quot;version&quot;: &quot;1.26.7&quot;
  },
  &quot;using_charset_normalizer&quot;: true,
  &quot;using_pyopenssl&quot;: false
}"><pre class="notranslate">{
  <span class="pl-ent">"chardet"</span>: {
    <span class="pl-ent">"version"</span>: <span class="pl-c1">null</span>
  },
  <span class="pl-ent">"charset_normalizer"</span>: {
    <span class="pl-ent">"version"</span>: <span class="pl-s"><span class="pl-pds">"</span>2.0.9<span class="pl-pds">"</span></span>
  },
  <span class="pl-ent">"cryptography"</span>: {
    <span class="pl-ent">"version"</span>: <span class="pl-s"><span class="pl-pds">"</span><span class="pl-pds">"</span></span>
  },
  <span class="pl-ent">"idna"</span>: {
    <span class="pl-ent">"version"</span>: <span class="pl-s"><span class="pl-pds">"</span>3.3<span class="pl-pds">"</span></span>
  },
  <span class="pl-ent">"implementation"</span>: {
    <span class="pl-ent">"name"</span>: <span class="pl-s"><span class="pl-pds">"</span>CPython<span class="pl-pds">"</span></span>,
    <span class="pl-ent">"version"</span>: <span class="pl-s"><span class="pl-pds">"</span>3.10.1<span class="pl-pds">"</span></span>
  },
  <span class="pl-ent">"platform"</span>: {
    <span class="pl-ent">"release"</span>: <span class="pl-s"><span class="pl-pds">"</span>10<span class="pl-pds">"</span></span>,
    <span class="pl-ent">"system"</span>: <span class="pl-s"><span class="pl-pds">"</span>Windows<span class="pl-pds">"</span></span>
  },
  <span class="pl-ent">"pyOpenSSL"</span>: {
    <span class="pl-ent">"openssl_version"</span>: <span class="pl-s"><span class="pl-pds">"</span><span class="pl-pds">"</span></span>,
    <span class="pl-ent">"version"</span>: <span class="pl-c1">null</span>
  },
  <span class="pl-ent">"requests"</span>: {
    <span class="pl-ent">"version"</span>: <span class="pl-s"><span class="pl-pds">"</span>2.27.1<span class="pl-pds">"</span></span>
  },
  <span class="pl-ent">"system_ssl"</span>: {
    <span class="pl-ent">"version"</span>: <span class="pl-s"><span class="pl-pds">"</span>101010cf<span class="pl-pds">"</span></span>
  },
  <span class="pl-ent">"urllib3"</span>: {
    <span class="pl-ent">"version"</span>: <span class="pl-s"><span class="pl-pds">"</span>1.26.7<span class="pl-pds">"</span></span>
  },
  <span class="pl-ent">"using_charset_normalizer"</span>: <span class="pl-c1">true</span>,
  <span class="pl-ent">"using_pyopenssl"</span>: <span class="pl-c1">false</span>
}</pre></div>
<p dir="auto">With pyrequest pullrequest <a class="commit-link" data-hovercard-type="commit" data-hovercard-url="https://github.com/psf/requests/commit/03957eb1c2b9a1e5e6d61f5e930d7c5ed7cfe853/hovercard" href="https://github.com/psf/requests/commit/03957eb1c2b9a1e5e6d61f5e930d7c5ed7cfe853"><tt>03957eb</tt></a> v2.25.0 urllib3 is updated to v1.26.0. with this version bump urllib3 has changed default behavior in regards to header "User-Agent" : <a href="https://pypi.org/project/urllib3/" rel="nofollow">https://pypi.org/project/urllib3/</a></p>
<p dir="auto">urllib3 1.26.0</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="Added default User-Agent header to every request (Pull #1750)
Added urllib3.util.SKIP_HEADER for skipping User-Agent, Accept-Encoding, and Host headers from being automatically emitted with requests (Pull #2018)"><pre class="notranslate"><code class="notranslate">Added default User-Agent header to every request (Pull #1750)
Added urllib3.util.SKIP_HEADER for skipping User-Agent, Accept-Encoding, and Host headers from being automatically emitted with requests (Pull #2018)
</code></pre></div>
<p dir="auto">Urllib3 now introduces default User-Agent header when no user-agent header is set. Urlib3 also introduces the function "urllib3.util.SKIP_HEADER" as a means to deactivate default user-agent header.</p>
<h2 dir="auto">Expected Result</h2>
<p dir="auto">Pyrequest should adopt easy means of deactivating "User-Agent" headers by utilizing the "urllib3.util.SKIP_HEADER" function</p>
<h2 dir="auto">Actual Result</h2>
<p dir="auto">Default "User-agent" header is enforced when no header= is specified.<br>
by using headers={"User-Agent": none} no longer deactivate default "user-agent" while using headers={"User-Agent": ""} will deactivate "user-agent" header</p>
<h2 dir="auto">Reproduction Steps</h2>
<div class="highlight highlight-source-python notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="import requests

req = Request('POST', url=BASE_URL + endpoint, data=params).prepare()  "><pre class="notranslate"><span class="pl-k">import</span> <span class="pl-s1">requests</span>

<span class="pl-s1">req</span> <span class="pl-c1">=</span> <span class="pl-v">Request</span>(<span class="pl-s">'POST'</span>, <span class="pl-s1">url</span><span class="pl-c1">=</span><span class="pl-v">BASE_URL</span> <span class="pl-c1">+</span> <span class="pl-s1">endpoint</span>, <span class="pl-s1">data</span><span class="pl-c1">=</span><span class="pl-s1">params</span>).<span class="pl-en">prepare</span>()  </pre></div>
<p dir="auto">---&gt; Deafult "user-agent" is enforced "User-Agent: python-urllib3/1.26.2"</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="req = Request('POST', url=BASE_URL + endpoint, headers={&quot;User-Agent&quot;: None}, data=params).prepare()"><pre class="notranslate"><code class="notranslate">req = Request('POST', url=BASE_URL + endpoint, headers={"User-Agent": None}, data=params).prepare()
</code></pre></div>
<p dir="auto">---&gt; Does not deactivate "User-Agent"</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="req = Request('POST', url=BASE_URL + endpoint, headers={&quot;User-Agent&quot;: &quot;&quot;}, data=params).prepare()"><pre class="notranslate"><code class="notranslate">req = Request('POST', url=BASE_URL + endpoint, headers={"User-Agent": ""}, data=params).prepare()
</code></pre></div>
<p dir="auto">Deactivates "User-Agent" succesfully</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="
## System Information

    $ python -m requests.help
"><pre class="notranslate"><code class="notranslate">
## System Information

    $ python -m requests.help

</code></pre></div>

```
<p dir="auto">This command is only available on Requests v2.16.4 and greater. Otherwise,<br>
please provide some basic information about your system (Python version,<br>
operating system, &amp;c).</p>
<p dir="auto">Python 3.8, Docker</p>