title: Why python post request returns 200 html while CURL returns 303(redirection)?
body: <p>Here's the cURL , copied directly from the dev tools:</p>
  <pre><code>curl &quot;https://*.php&quot; -H &quot;User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:86.0) Gecko/20100101 Firefox/86.0&quot; -H &quot;Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8&quot; -H &quot;Accept-Language: es-ES,es;q=0.8,en-US;q=0.5,en;q=0.3&quot; --compressed -H &quot;Content-Type: application/x-www-form-urlencoded&quot; -H &quot;Origin: https://moodle.upm.es&quot; -H &quot;DNT: 1&quot; -H &quot;Connection: keep-alive&quot; -H &quot;Referer: https://moodle.upm.es/titulaciones/oficiales/login/auth_index.php&quot; -H &quot;Cookie: **********&quot; -H &quot;Upgrade-Insecure-Requests: 1&quot; --data-raw &quot;password=***********&quot;%&quot;3D&quot;%&quot;3D&amp;username=**********&amp;logintoken=***********&quot;
  The reponse is a 303 code
  </code></pre>
  <p>When I try to do the same in Python:</p>
  <pre><code>    mainsession = requests.post('https://*.php', headers=header, cookies=cookies, data=data)
  </code></pre>
  <p>It returns a 200 code and the response is an error page.</p>
  <p>I've copied correctly all the headers and the other Post requests of my code work well so I don't know what I'm doing wrong.</p>