title: urllib2 - post request
body: <p>I try to perform a simple POST-request with urllib2. 
  However the servers response indicates that it receives a simple GET. I checked the type of the outgoing request, but it is set to POST. <br>
  To check whether the server behaves like I expect it to, I tried to perform a GET request with the (former POST-) data concatenated to the url. This got me the answer I expected. <br> Does anybody have a clue what I misunderstood?</p>
  
  <pre><code>def connect(self):
      url = 'http://www.mitfahrgelegenheit.de/mitfahrzentrale/Dresden/Potsdam.html/'
      user_agent = 'Mozilla/4.0 (compatible; MSIE 5.5; Windows NT)'
      header = { 'User-Agent' : user_agent }
  
      values = {
        'city_from' : 69,
        'radius_from' : 0,
        'city_to' : 263,
        'radius_to' : 0,
        'date' : 'date',
        'day' : 5,
        'month' : 03,
        'year' : 2012,
        'tolerance' : 0
      }
  
      data = urllib.urlencode(values)
      # req = urllib2.Request(url+data, None, header) # GET works fine
      req = urllib2.Request(url, data, header)  # POST request doesn't not work
  
      self.response = urllib2.urlopen(req)
  </code></pre>
  
  <p>This seems to be a problem like the one discussed here: <a href="https://stackoverflow.com/questions/3238925/python-urllib-urllib2-post">Python URLLib / URLLib2 POST</a> but I'm quite sure that in my case the trailing slash is not missing. ;) <br><br>
  I fear this might be a stupid misconception, but I'm already wondering for hours!</p>
  
  <p><strong><br><br> EDIT: A convenience function for printing:</strong></p>
  
  <pre><code>def response_to_str(response):
      return response.read()
  
  def dump_response_to_file(response):
      f = open('dump.html','w')
      f.write(response_to_str(response))
  </code></pre>
  
  <p><strong><br><br> EDIT 2: Resolution:</strong> <br>
  I found a tool to capture the real interaction with the site, <a href="http://fiddler2.com/fiddler2/" rel="nofollow noreferrer">http://fiddler2.com/fiddler2/</a>. Apparently the server takes the data from the input form, redirects a few times and and then makes a GET request with this data simply appended to the url.<br>
  Everything is fine with urllib2 and I apologize for misusing your time!</p>