title: Python requests too slow compared to Postman or cURL
body: <p>I am trying to make a single API call using different approaches in Python3 but they are all incredibly slow if I compare with the same request in Postman and/or cURL.</p>
  <p>This is what I am trying:</p>
  <pre><code>headers = {
     &quot;Authorization&quot;: &quot;Bearer &quot; + self.access_token,
     &quot;Content-Type&quot;: &quot;application/json&quot;,
     &quot;Accept-Encoding&quot;: &quot;gzip, deflate, br&quot;,
     &quot;Connection&quot;: &quot;keep-alive&quot;,
     &quot;Accept&quot;: &quot;*/*&quot;,
     &quot;User-Agent&quot;: &quot;PostmanRuntime/7.28.2&quot;,
     &quot;Cache-Control&quot;: &quot;no-cache&quot;
  }
  
  session = requests.Session()
  api_res = session.get(self.api_endpoint, headers=headers, timeout=self.req_timeout,)
  </code></pre>
  <p>When running this call, it gets stuck for a few minutes until I receive a response. If I use Postman for example, I get the result in 1 second or less.</p>
  <p>I also tried using <code>http.client</code>, <code>urllib3</code> but I still see a huge delay in the call.</p>
  <p>I also tried debugging the call:</p>
  <pre><code>import http.client
  
  http.client.HTTPConnection.debuglevel = 1
  logging.basicConfig()
  logging.getLogger().setLevel(logging.DEBUG)
  requests_log = logging.getLogger(&quot;requests.packages.urllib3&quot;)
  requests_log.setLevel(logging.DEBUG)
  requests_log.propagate = True
  </code></pre>
  <p>Debug response:</p>
  <pre><code>[DEBUG] Starting new HTTPS connection (1): ...:443
  
  header: Content-Type: application/json; charset=utf-8
  header: Content-Length: 61
  header: Connection: keep-alive
  header: Date: ...
  header: Cache-Control: no-cache
  header: Pragma: no-cache
  header: Expires: -1
  header: WWW-Authenticate: Bearer
  header: Access-Control-Allow-Origin: *
  header: P3P: CP=&quot;IDC DSP COR ADM DEVi TAIi PSA PSD IVAi IVDi CONi HIS OUR IND CNT&quot;
  header: Access-Control-Allow-Methods: GET, POST, OPTIONS, HEAD
  header: X-XSS-Protection: 1; mode=block
  header: Access-Control-Allow-Headers: accept, authorization, content-type, Cache-Control, P3P, GE-IGNORE-CACHE, Signature, fromMobile, ssoToken, fromAdmin, fromGameapp, fromGtv, fromGameapp, ManagerOrgUnitUserName, ManagerOrgUnitId, g-s-x, g-s-x-t, g-s-i-i, User-Agent, Referer, Origin, Access-Control-Allow-Headers
  header: X-Content-Type-Options: nosniff
  header: X-XSS-Protection: 1; mode=block
  header: Referrer-Policy: same-origin
  header: Strict-Transport-Security: max-age=31536000; includeSubDomains
  header: X-Cache: Error from cloudfront
  header: Via: 1.1 ....cloudfront.net (CloudFront)
  header: X-Amz-Cf-Pop: ORD52-C1
  header: X-Amz-Cf-Id: ...
  </code></pre>
  <p>Any ideas about why is it so slow? What it doesn't happen when I replicate to Postman for example?</p>
  <p>Even from Google is taking a lot of time:</p>
  <pre><code>requests.get(&quot;https://www.google.com&quot;)
  </code></pre>
  <p>I also realized that it's working with ipv4 and NOT with ipv6.</p>
  <p>Thanks!</p>