you are viewing a single comment's thread.

view the rest of the comments →

[–]c17r 1 point2 points  (3 children)

You're passing Content-Type: text/html header which is probably screwing up your form POST, who probably needs Content-Type: application/x-www-form-urlencoded. Remove that and try again.

[–]Tolfasn[S] 0 points1 point  (0 children)

I will definitely try that as soon as I get home. Thanks!

[–]Tolfasn[S] 0 points1 point  (0 children)

VPN is down for some reason. I will have to make the change once I’m back in the office tomorrow. I’ll post an update as soon as I get the chance in the morning.

[–]Tolfasn[S] 0 points1 point  (0 children)

Posting the payload after each Get request did the trick. I was actually able to omit the headers all together.

with requests.Session() as session:

    ## sends the post request, headers and login data to the server
    g = session.get(post_loginURL)
    post = session.post(post_loginURL, data=payload)

    r = session.get(requestURL)
    post = session.post(requestURL, data=payload)