I have the following command in Curl that makes a POST request.
curl -i -s -k -X $'POST' \
-H $'Host: router.jorge.com' -H $'User-Agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:60.0) Gecko/20100101 Firefox/60.0' -H $'Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8' -H $'Accept-Language: en-GB,en;q=0.5' -H $'Accept-Encoding: gzip, deflate' -H $'Referer: http://router.jorge.com/Main_Login.asp' -H $'Content-Type: application/x-www-form-urlencoded' -H $'Content-Length: 150' -H $'Cookie: traffic_warning_NaN=2018.5:1; search_initproduct=global,ZenFone 5,https://www.jorge.com/Phone/ZenFone-5-ZE620KL/' -H $'Connection: close' -H $'Upgrade-Insecure-Requests: 1' \
-b $'traffic_warning_NaN=2018.5:1; search_initproduct=global,ZenFone 5,https://www.jorge.com/Phone/ZenFone-5-ZE620KL/' \
--data-binary $'group_id=&action_mode=&action_script=&action_wait=5¤t_page=Main_Login.asp&next_page=index.asp&login_authorization=HYDshstysTGVub3ZvMjAxODIwMTg%3D' \
$'http://router.jorge.com/login.cgi'
I would like to make the same request, only in Python using the requests. First I tried to pass the Headers like this:
import requests
data = {'Host' : 'https://putsreq.com', 'User-Agente' : 'Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:60.0) Gecko/20100101 Firefox/60.0', 'Accept' : 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8', 'Accept-Language' : 'en-GB,en;q=0.5', 'Referer' : 'http://router.jorge.com/Main_Login.asp', 'Content-Type' : 'application/x-www-form-urlencoded', 'Content-Length' : '150', 'Connection' : 'close', 'Upgrade-Insecure-Requests' : '1'}
login = requests.post('http://router.jorge.com/', headers=data)
print(login.text)
When I run the script, Python simply does not respond.