title: Using requests/webbrowser to POST to browser?
body: <p>I am making a program in Python 2.7 which I want to POST a URL to the browser. Here is my code which should explain it much better than I can:</p>
  
  <pre><code>import requests, json, webbrowser
  
  pid = "AQ6723"
  size = "660"
  recaptcha = ""
  
  baseURL = 'http://www.adidas.co.uk/on/demandware.store/Sites-adidas-GB-Site/en_GB/Cart-MiniAddProduct'
  
  payload = {
              'dwfrm_cart_continueShopping': 'Continue+Shopping',
              'layer': 'Add+To+Bag+overlay',
              'pid': '%20' + pid + '_' + size,
              'pid': '%20' + pid + '_' + size,
              'g-recaptcha-response': recaptcha,
              'Quantity': "1",
              'masterPid': pid,
              'ajax': "true"
          }
  
  headers = {
              'Host': 'www.adidas.co.uk',
              'Connection': 'keep-alive',
              'Content-Length': '85',
              'Accept': '*/*',
              'Origin': 'http://www.adidas.co.uk',
              'X-Requested-With': 'XMLHttpRequest',
              'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/49.0.2623.112 Safari/537.36',
              'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8',
              'Accept-Encoding': 'gzip, deflate',
              'Accept-Language': 'en-US,en;q=0.8,de;q=0.6',
          }
  
  print(pid)
  
  finishedProduct = requests.post(baseURL, data = json.dumps(payload), headers = headers)
  
  webbrowser.open(finishedProduct)
  </code></pre>
  
  <p>This obviously isn't correct but how could I "achieve" this? I just want to be able to see the result of the POST request in browser which ultimately would be a product in-cart.</p>