I'm trying to use the python 'requests' lib to submit an https post. however, i keep running into this error "CSRF verification failed. Request aborted"
I have reviewed all similar issues reported on the forum but unable to find a solution.
Below is my python code. Appreciate any help.
import requests
payload = {
'targetip': 'www.ndtv.com'
}
header = {
'User-Agent': 'python-requests/2.20.1',
'Accept-Encoding': 'gzip, deflate',
'Accept': '*/*',
'Connection': 'keep-alive',
'Referer':'https://dnsdumpster.com/'
}
url = r'https://dnsdumpster.com/'
with requests.session() as s:
res = s.get(url)
cookie = s.cookies
res = requests.post(url, data=payload, headers = header, cookies = cookie)
print(res.text)