title: HTTP headers - Requests - Python
body: <p>I am trying to scrape a website in which the request headers are having some new (for me) attributes such as <code>:authority, :method, :path, :scheme</code>.</p>
  
  <pre><code>{':authority':'xxxx',':method':'GET',':path':'/xxxx',':scheme':'https','accept':'text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8','accept-encoding':'gzip, deflate, br','accept-language':'en-US,en;q=0.9','cache-control':'max-age=0',GOOGLE_ABUSE_EXEMPTION=ID=0d5af55f1ada3f1e:TM=1533116294:C=r:IP=182.71.238.62-:S=APGng0u2o9IqL5wljH2o67S5Hp3hNcYIpw;1P_JAR=2018-8-1-9',   'upgrade-insecure-requests': '1',   'user-agent': 'Mozilla/5.0(WindowsNT6.1;Win64;x64)AppleWebKit/537.36(KHTML,likeGecko)Chrome/68.0.3440.84Safari/537.36',   'x-client-data': 'CJG2yQEIpbbJAQjEtskBCKmdygEI2J3KAQioo8oBCIKkygE=' }
  </code></pre>
  
  <p>I tried passing them as headers with http request but ended up with error as shown below.</p>
  
  <blockquote>
    <p>ValueError: Invalid header name b':scheme'</p>
  </blockquote>
  
  <p>Any help would be appreciated on understanding and guidance on using them in passing request.</p>
  
  <p>EDIT: 
  code added </p>
  
  <pre><code>import requests
  
  url = 'https://www.google.co.in/search?q=some+text'
  
  headers = {':authority':'xxxx',':method':'GET',':path':'/xxxx',':scheme':'https','accept':'text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8','accept-encoding':'gzip, deflate, br','accept-language':'en-US,en;q=0.9','cache-control':'max-age=0','upgrade-insecure-requests': '1',   'user-agent': 'Mozilla/5.0(WindowsNT6.1;Win64;x64)AppleWebKit/537.36(KHTML,likeGecko)Chrome/68.0.3440.84Safari/537.36',   'x-client-data': 'CJG2yQEIpbbJAQjEtskBCKmdygEI2J3KAQioo8oBCIKkygE=' }
  
  response = requests.get(url, headers=headers)
  
  print(response.text)
  </code></pre>