I don't understand why the connection aborted, I have included headers and cookies in my request. Any input would be highly appreciated.
import requests
url = 'https://fp.trafikverket.se/boka/#/search/SPHhISIPAfhPP/5/0/0/0'
s = requests.session()
res = s.get(url)
cookies = dict(res.cookies)
headers = dict(res.headers)
headers['User-Agent'] = 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.87 Safari/537.36'
r = s.post(url,
cookies=cookies, headers=headers).text
>>> requests.exceptions.ConnectionError: ('Connection aborted.', OSError("(54, 'ECONNRESET')",))
postto the URL, indeed?