title: python requests 403 forbidden but it's used with charles on
body: <ul>
  <li>I get 403 forbidden when I use python requests to access .</li>
  <li>However, when I open <a href="https://www.charlesproxy.com/" rel="nofollow noreferrer">Charles</a> proxy it works.</li>
  <li>When I open fiddler, I also get 403.</li>
  </ul>
  <p>I wanna know why this happens.</p>
  <pre><code>import requests
  
  
  
  def get_test():
      # proxies = {'http': 'http://127.0.0.1:8888', 'https': 'http://127.0.0.1:8888'}
      proxies=None
      url = &quot;&quot;
  
      my_header={
          'accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9',
          'accept-encoding': 'gzip, deflate, br',
          'accept-language': 'zh-CN,zh;q=0.9,en-US;q=0.8,en;q=0.7,ja;q=0.6,zh-HK;q=0.5',
          'cache-control': 'max-age=0',        'sec-ch-ua': '&quot; Not;A Brand&quot;;v=&quot;99&quot;, &quot;Google Chrome&quot;;v=&quot;91&quot;, &quot;Chromium&quot;;v=&quot;91&quot;',
          'sec-ch-ua-mobile': '?0',
          'sec-fetch-dest': 'document',
          'sec-fetch-mode': 'navigate',
          'sec-fetch-site': 'none',
          'sec-fetch-user': '?1',
          'upgrade-insecure-requests': '1',
          'user-agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.124 Safari/537.36',
  
      }
      rsp = requests.get(url=url,headers=my_header)
      print(rsp)
  
  
  if __name__ == '__main__':
      get_test()
  </code></pre>