title: Python Requests post on a site not working
body: <p>I am trying to scrape property information from <a href="https://www.ura.gov.sg/realEstateIIWeb/resiRental/search.action" rel="nofollow">https://www.ura.gov.sg/realEstateIIWeb/resiRental/search.action</a> using Python Requests. Using Chrome I have inspected the POST request and emulated it using requests. I use sessions to maintain cookies. When I try my code, the return from the website is "missing parameters in search query" so obviously something is wrong with my requests (though it is not obvious what).</p>
  
  <p>Doing some digging there was one cookie that I did not get when doing request.get on the search side, so I added that manually. Still no go. I tried emulating the request headers exactly as well, still does not return the correct results.</p>
  
  <p>The only time I have gotten it to work is when I manually copy the cookies from my browser to the Python request object.</p>
  
  <pre><code>url = 'https://www.ura.gov.sg/realEstateIIWeb/resiRental/submitSearch.action;jsessionid={}'
  
  values = {'submissionType': 'pn',
            'from_Date_Prj': 'JAN-2014',
            'to_Date_Prj': 'JAN-2016',
            '__multiselect_projectNameList': '',
            'selectedProjects': '10 SHELFORD',
            '__multiselect_selectedProjects': '',
            'propertyType': 'lp',
            'from_Date': 'JAN-2016',
            'to_Date': 'JAN-2016',
            '__multiselect_postalDistrictList': '',
            '__multiselect_selectedPostalDistricts': ''}
  header1 = {
      'Accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8',
      'Accept-Encoding': 'gzip, deflate, sdch',
      'Accept-Language': 'en-US,en;q=0.8,nb;q=0.6,no;q=0.4',
      'Cache-Control': 'max-age=0',
      'Connection': 'keep-alive',
      'Host': 'www.ura.gov.sg',
      'Upgrade-Insecure-Requests': '1',
      'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/48.0.2564.116 Safari/537.36'
  }
  
  headers = {
      'Accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8',
      'Accept-Encoding': 'gzip, deflate',
      'Accept-Language': 'en-US,en;q=0.8,nb;q=0.6,no;q=0.4',
      'Cache-Control': 'max-age=0',
      'Connection': 'keep-alive',
      'Content-Type': 'application/x-www-form-urlencoded',
      'Host': 'www.ura.gov.sg',
      'Origin': 'https://www.ura.gov.sg',
      'Referer': 'https://www.ura.gov.sg/realEstateIIWeb/resiRental/search.action',
      'Upgrade-Insecure-Requests': '1',
      'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/48.0.2564.116 Safari/537.36'
  }
  
  with requests.Session() as r:
      page1 = r.get('https://www.ura.gov.sg/realEstateIIWeb/resiRental/search.action', headers=header1)
      requests.utils.add_dict_to_cookiejar(r.cookies, {'BIGipServerpl-prod_iis_web_v4': '3334383808.20480.0000'})
      page2 = r.post(url.format(r.cookies.get_dict()['JSESSIONID']), data=values, headers=headers)
  </code></pre>